[Snek] [keith-packard/snek] 58b169: Re-work slice code. Include tests.

Keith Packard noreply at github.com
Sun Feb 17 22:18:49 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/keith-packard/snek
  Commit: 58b169beb0da2695c5f2a45746704451bdd6ea51
      https://github.com/keith-packard/snek/commit/58b169beb0da2695c5f2a45746704451bdd6ea51
  Author: Keith Packard <keithp at keithp.com>
  Date:   2019-02-17 (Sun, 17 Feb 2019)

  Changed paths:
    M snek-code.c
    M snek-list.c
    M snek-string.c
    M snek.h
    M test/Makefile
    A test/slice.py

  Log Message:
  -----------
  Re-work slice code. Include tests.

Started by creating an exhaustive set of tests for slices, then made
the slice structure contain only the values relevant for
execution. Finally cleaned up the implementation to make it agree with
python3.

Signed-off-by: Keith Packard <keithp at keithp.com>


  Commit: 31ccea0e981c0e14b5d6d4de526ea2accd062298
      https://github.com/keith-packard/snek/commit/31ccea0e981c0e14b5d6d4de526ea2accd062298
  Author: Keith Packard <keithp at keithp.com>
  Date:   2019-02-17 (Sun, 17 Feb 2019)

  Changed paths:
    M snek-list.c

  Log Message:
  -----------
  Use list->alloc == 0 to indicate no data instead of list->data == 0

list->data == 0 could happen if the data were allocated at the start
of the heap (which is impossible, given that the list head will be
allocated before the data), but its still cleaner to not use it.

Signed-off-by: Keith Packard <keithp at keithp.com>


Compare: https://github.com/keith-packard/snek/compare/6588b36bc09c...31ccea0e981c


More information about the Snek mailing list