[Snek] [keith-packard/snek] 71976d: Add assert statement support

Keith Packard noreply at github.com
Thu Sep 12 04:20:24 PDT 2019


  Branch: refs/heads/master
  Home:   https://github.com/keith-packard/snek
  Commit: 71976db13aa00dbc67d7e6b759fe89f2cfd08eee
      https://github.com/keith-packard/snek/commit/71976db13aa00dbc67d7e6b759fe89f2cfd08eee
  Author: Paulo Henrique Silva <ph.silva at carta.com>
  Date:   2019-08-19 (Mon, 19 Aug 2019)

  Changed paths:
    M snek-code.c
    M snek-gram.ll
    M snek-keyword.builtin
    M snek.h
    M test/Makefile
    A test/assert-fail.py
    A test/assert-success.py

  Log Message:
  -----------
  Add assert statement support

This PR adds assert <expr> statement support to Snek.

When <expr> evaluates to False (per snek_poly_true criteria)
assert will print an AssertionError.

In the future we could add __debug__ so we can ignore
assertions while __debug__ is false.


  Commit: 9e3a1a5ce2cd00f64c9a8b8276e0a41a7d85ed5e
      https://github.com/keith-packard/snek/commit/9e3a1a5ce2cd00f64c9a8b8276e0a41a7d85ed5e
  Author: Paulo Henrique Silva <ph.silva at carta.com>
  Date:   2019-08-21 (Wed, 21 Aug 2019)

  Changed paths:
    M doc/snek.adoc

  Log Message:
  -----------
  Add documentation about assert


  Commit: 0b82de6eea70e760f450066f7d9d5cb4f2cf3f48
      https://github.com/keith-packard/snek/commit/0b82de6eea70e760f450066f7d9d5cb4f2cf3f48
  Author: Paulo Henrique Silva <ph.silva at carta.com>
  Date:   2019-08-21 (Wed, 21 Aug 2019)

  Changed paths:
    M snek-code.c

  Log Message:
  -----------
  Do not return the expression value after an assert


  Commit: 96fe24c0cc4bc461d516a662dac0251143388194
      https://github.com/keith-packard/snek/commit/96fe24c0cc4bc461d516a662dac0251143388194
  Author: Paulo Henrique Silva <ph.silva at carta.com>
  Date:   2019-08-21 (Wed, 21 Aug 2019)

  Changed paths:
    M snek.h

  Log Message:
  -----------
  Fix compilation when only SNEK_MEMORY debug is enabled


  Commit: 9801afa777476ed38c965f4028c886b53836377a
      https://github.com/keith-packard/snek/commit/9801afa777476ed38c965f4028c886b53836377a
  Author: Paulo Henrique Silva <ph.silva at carta.com>
  Date:   2019-08-27 (Tue, 27 Aug 2019)

  Changed paths:
    M snek-code.c
    M snek-gram.ll
    M snek-keyword.builtin
    M snek.defs
    M snek.h

  Log Message:
  -----------
  Add conditional compilation around assert

assert will not be compiled in by default, to enable it
run make SNEK_ASSERT=1


  Commit: fba9546fe7241b498f888b51d6ce92694e4ecf5b
      https://github.com/keith-packard/snek/commit/fba9546fe7241b498f888b51d6ce92694e4ecf5b
  Author: Paulo Henrique Silva <ph.silva at carta.com>
  Date:   2019-08-27 (Tue, 27 Aug 2019)

  Changed paths:
    M snek-keyword.builtin

  Log Message:
  -----------
  Fix typo on assert builtin definition


  Commit: a067a97127eca7c74ae4453c0c72fcdb01d5af8c
      https://github.com/keith-packard/snek/commit/a067a97127eca7c74ae4453c0c72fcdb01d5af8c
  Author: Paulo Henrique Silva <ph.silva at carta.com>
  Date:   2019-08-27 (Tue, 27 Aug 2019)

  Changed paths:
    M snek-builtin.py

  Log Message:
  -----------
  Add conditional compilation support for builtins

Now we can use #ifdef's inside builtin files just like a normal
C file.

example:

    value, VALUE


  Commit: 64a9e261e15191943eedeb7e6e7d3362c2197615
      https://github.com/keith-packard/snek/commit/64a9e261e15191943eedeb7e6e7d3362c2197615
  Author: Keith Packard <keithp at keithp.com>
  Date:   2019-09-12 (Thu, 12 Sep 2019)

  Changed paths:
    M ao/ao-led.c
    M ports/metrom0/ao-pins.h

  Log Message:
  -----------
  ao: Add support for LEDs which are active low

Allow each LED pin to state whether it needs to be inverted so that it
will be drive to 0 when on and 1 when off. Use this to fix the active
LED on the Metro M0 board.

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


  Commit: 2ff78d20c0fd2df2eb066636c4c73f02bfa1886b
      https://github.com/keith-packard/snek/commit/2ff78d20c0fd2df2eb066636c4c73f02bfa1886b
  Author: Keith Packard <keithp at keithp.com>
  Date:   2019-09-12 (Thu, 12 Sep 2019)

  Changed paths:
    M doc/snek-book-theme.yml
    M doc/snek-theme.yml

  Log Message:
  -----------
  Fix doc licenses from CC SA to GPLv3+

Make all licenses GPLv3 compatible

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


  Commit: 1d9188b5a715e816efc228a83dbe4b11c719ea13
      https://github.com/keith-packard/snek/commit/1d9188b5a715e816efc228a83dbe4b11c719ea13
  Author: Keith Packard <keithp at keithp.com>
  Date:   2019-09-12 (Thu, 12 Sep 2019)

  Changed paths:
    M snek-builtin.py

  Log Message:
  -----------
  Merge remote-tracking branch 'phsilva/conditional-builtins'


  Commit: 153bff4d7a1d31b0bbceeffadd7c66b3a282d7dc
      https://github.com/keith-packard/snek/commit/153bff4d7a1d31b0bbceeffadd7c66b3a282d7dc
  Author: Keith Packard <keithp at keithp.com>
  Date:   2019-09-12 (Thu, 12 Sep 2019)

  Changed paths:
    M doc/snek.adoc
    M snek-code.c
    M snek-gram.ll
    M snek-keyword.builtin
    M snek.defs
    M snek.h
    M test/Makefile
    A test/assert-fail.py
    A test/assert-success.py

  Log Message:
  -----------
  Merge commit 'fba9546fe7241b498f888b51d6ce92694e4ecf5b'


  Commit: fda2798766e6745fab7dd5c7436adeca17c94d06
      https://github.com/keith-packard/snek/commit/fda2798766e6745fab7dd5c7436adeca17c94d06
  Author: Keith Packard <keithp at keithp.com>
  Date:   2019-09-12 (Thu, 12 Sep 2019)

  Changed paths:
    M ports/duemilanove/Makefile
    M ports/itsybitsy3v/Makefile
    M ports/itsybitsy5v/Makefile
    M snek.defs

  Log Message:
  -----------
  Enable 'assert' by default

Disable on avr32u4 itsy and duemilanove boards because it doesn't fit.

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


  Commit: c832658a57c6be12d01527b7b43b6ca53d0eb907
      https://github.com/keith-packard/snek/commit/c832658a57c6be12d01527b7b43b6ca53d0eb907
  Author: Keith Packard <keithp at keithp.com>
  Date:   2019-09-12 (Thu, 12 Sep 2019)

  Changed paths:
    A examples/servo-car.py

  Log Message:
  -----------
  Add 'servo-car' example

This example controls a model with a motor to drive forward/backward
and a servo for turning.

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


  Commit: 6bd99932c2be6d2bec906a1c3245fee5f43c22a3
      https://github.com/keith-packard/snek/commit/6bd99932c2be6d2bec906a1c3245fee5f43c22a3
  Author: Keith Packard <keithp at keithp.com>
  Date:   2019-09-12 (Thu, 12 Sep 2019)

  Changed paths:
    M ports/snekboard/.gitignore
    M ports/snekboard/Makefile
    A ports/snekboard/snek-board-install.1
    A ports/snekboard/snek-board-install.in

  Log Message:
  -----------
  ports/snekboard: Add snek-board install script

This installs the bootloader and snek binary to the target device
using an STlinkv2 device.

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


Compare: https://github.com/keith-packard/snek/compare/21d7ecd3897f...6bd99932c2be


More information about the Snek mailing list