[Snek] [keith-packard/snek] a6d591: Initialize snek_globals from snek_init macro

Keith Packard noreply at github.com
Sun Dec 12 22:20:27 PST 2021


  Branch: refs/heads/str-builtin
  Home:   https://github.com/keith-packard/snek
  Commit: a6d591dfb0f194d97798181f8c46effc8acdd9df
      https://github.com/keith-packard/snek/commit/a6d591dfb0f194d97798181f8c46effc8acdd9df
  Author: Keith Packard <keithp at keithp.com>
  Date:   2021-12-12 (Sun, 12 Dec 2021)

  Changed paths:
    M snek-builtin.py
    M snek-frame.c

  Log Message:
  -----------
  Initialize snek_globals from snek_init macro

This gets rid of a conditional needed in snek_pick_frame and avoids a
crash in snek_id_del if called before snek_globals was initialized.

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


  Commit: e65b93a8adddfc3c0f8416946403adc807672d59
      https://github.com/keith-packard/snek/commit/e65b93a8adddfc3c0f8416946403adc807672d59
  Author: Keith Packard <keithp at keithp.com>
  Date:   2021-12-12 (Sun, 12 Dec 2021)

  Changed paths:
    M snek-print.c

  Log Message:
  -----------
  Remove line number from function print result

Printing the line number where a function was defined was kinda nice,
but it takes a bunch of code space which can be better used for other
things.

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


  Commit: ff3e4c532eb8d2b9ed5db6a5b86e8ab4ad339e21
      https://github.com/keith-packard/snek/commit/ff3e4c532eb8d2b9ed5db6a5b86e8ab4ad339e21
  Author: Keith Packard <keithp at keithp.com>
  Date:   2021-12-12 (Sun, 12 Dec 2021)

  Changed paths:
    M snek-print.c

  Log Message:
  -----------
  Initialize the format for printing more efficiently

Putting the format on the stack and initializing it with statements
takes less space than having it static and initialized partially at
boot time and partially at runtime.

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


  Commit: f5c97a443e316fae0f96337106c910a322229104
      https://github.com/keith-packard/snek/commit/f5c97a443e316fae0f96337106c910a322229104
  Author: Keith Packard <keithp at keithp.com>
  Date:   2021-12-12 (Sun, 12 Dec 2021)

  Changed paths:
    M snek-gram.ll

  Log Message:
  -----------
  Merge a couple of actions together in 'DEF'

Setting nformal/nnamed can wait until the NAME is lexed, merging these
actions together saves a bit of text space.

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


  Commit: 7637490bbd7a3872fc767786e32c1bb0ca7b2deb
      https://github.com/keith-packard/snek/commit/7637490bbd7a3872fc767786e32c1bb0ca7b2deb
  Author: Keith Packard <keithp at keithp.com>
  Date:   2021-12-12 (Sun, 12 Dec 2021)

  Changed paths:
    M snek-print.c

  Log Message:
  -----------
  Fix list printing to use 'a' format for elements

Lists/dicts/tuples always have their elements printed in 'a' format so
that you can see the strings clearly.

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


  Commit: baaf73b54620fcc135326fe872b0061a31512e6a
      https://github.com/keith-packard/snek/commit/baaf73b54620fcc135326fe872b0061a31512e6a
  Author: Keith Packard <keithp at keithp.com>
  Date:   2021-12-12 (Sun, 12 Dec 2021)

  Changed paths:
    M snek-input.builtin
    M snek-string.c
    M test/Makefile
    A test/pass-str.py

  Log Message:
  -----------
  Add 'str' builtin

This is the same as using %s format on the object

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


Compare: https://github.com/keith-packard/snek/compare/1ec15b6587ba...baaf73b54620


More information about the Snek mailing list