[Snek] [keith-packard/snek] 0ce59d: Allow trailing comma in tuples, lists and paramete...

Keith Packard noreply at github.com
Tue Feb 18 12:17:37 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/keith-packard/snek
  Commit: 0ce59de07143f9ada113edc5f65f9e3991c1d637
      https://github.com/keith-packard/snek/commit/0ce59de07143f9ada113edc5f65f9e3991c1d637
  Author: Keith Packard <keithp at keithp.com>
  Date:   2020-02-18 (Tue, 18 Feb 2020)

  Changed paths:
    M snek-gram.ll

  Log Message:
  -----------
  Allow trailing comma in tuples, lists and parameter lists

Python allows a trailing comma here, and black adds them
when wrapping them across multiple lines, so we should also
allow them in snek.

Note that this requires lola version 1.3 as previous lola versions
could not handle grammars with mutually recursive productions

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


  Commit: 0dd4cf5bc25f82b82837c6ec264e9470b8b1b8f0
      https://github.com/keith-packard/snek/commit/0dd4cf5bc25f82b82837c6ec264e9470b8b1b8f0
  Author: Keith Packard <keithp at keithp.com>
  Date:   2020-02-18 (Tue, 18 Feb 2020)

  Changed paths:
    M snek-gram.ll

  Log Message:
  -----------
  Allow trailing comma on dictionaries

Just like tuples, lists, and parameter lists, dictionaries
may have a trailing comma after the last item

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


  Commit: 886e65a99edadbe6829252a4beb4e463d2cbbd86
      https://github.com/keith-packard/snek/commit/886e65a99edadbe6829252a4beb4e463d2cbbd86
  Author: Keith Packard <keithp at keithp.com>
  Date:   2020-02-18 (Tue, 18 Feb 2020)

  Changed paths:
    M test/Makefile
    R test/actual-named-first.py
    R test/andor.py
    R test/arg-dup1.py
    R test/arg-dup2.py
    R test/arg-unknown.py
    R test/args-missing.py
    R test/args.py
    R test/assert-fail.py
    R test/assert-success.py
    R test/dict.py
    R test/equal_is.py
    A test/fail-actual-named-first.py
    A test/fail-arg-dup1.py
    A test/fail-arg-dup2.py
    A test/fail-arg-unknown.py
    A test/fail-args-missing.py
    A test/fail-assert-fail.py
    A test/fail-formal-named-first.py
    A test/fail-interpolate-badformat.py
    A test/fail-interpolate-extra.py
    A test/fail-interpolate-missing.py
    A test/fail-range-named.py
    A test/fail-scoping-no-decl.py
    A test/fail-syntax-lex-bang.py
    A test/fail-syntax-list-named.py
    A test/fail-syntax-tuple-named.py
    R test/float.py
    R test/for-array.py
    R test/for-break.py
    R test/for-nested.py
    R test/for-range.py
    R test/for-string.py
    R test/formal-named-first.py
    R test/get.py
    R test/global.py
    R test/if.py
    R test/int.py
    R test/interpolate-badformat.py
    R test/interpolate-extra.py
    R test/interpolate-list.py
    R test/interpolate-missing.py
    R test/interpolate-str.py
    R test/lex-bang.py
    R test/list-named.py
    R test/list.py
    R test/math.py
    R test/none.py
    R test/op.py
    A test/pass-andor.py
    A test/pass-args.py
    A test/pass-assert-success.py
    A test/pass-dict.py
    A test/pass-equal_is.py
    A test/pass-float.py
    A test/pass-for-array.py
    A test/pass-for-break.py
    A test/pass-for-nested.py
    A test/pass-for-range.py
    A test/pass-for-string.py
    A test/pass-get.py
    A test/pass-global.py
    A test/pass-if.py
    A test/pass-int.py
    A test/pass-interpolate-list.py
    A test/pass-interpolate-str.py
    A test/pass-list.py
    A test/pass-math.py
    A test/pass-none.py
    A test/pass-op.py
    A test/pass-range.py
    A test/pass-scoping-global.py
    A test/pass-scoping-local.py
    A test/pass-slice.py
    A test/pass-while-break.py
    A test/pass-while-else.py
    A test/pass-while.py
    R test/range-named.py
    R test/range.py
    R test/scoping-global.py
    R test/scoping-local.py
    R test/scoping-no-decl.py
    R test/slice.py
    R test/tuple-named.py
    R test/while-break.py
    R test/while-else.py
    R test/while.py

  Log Message:
  -----------
  test: Rename tests to make clear their intended effect

There are three classes now, indicated by the leading word(s) in the name:

	pass-		This test should pass
	fail-syntax-	This test should fail with a syntax error
	fail-		This test should fail

The syntax tests are special because we cannot re-format them with
'black' due to the intentional syntax errors.

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


  Commit: e15b09eefd0c91f5d920a011c2fc7ceedcc9c197
      https://github.com/keith-packard/snek/commit/e15b09eefd0c91f5d920a011c2fc7ceedcc9c197
  Author: Keith Packard <keithp at keithp.com>
  Date:   2020-02-18 (Tue, 18 Feb 2020)

  Changed paths:
    M Makefile

  Log Message:
  -----------
  Cause 'make all' to fail if any subdir fails

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


  Commit: 3108d0006234a0c71fa9d6af7ccce331a06ec6b4
      https://github.com/keith-packard/snek/commit/3108d0006234a0c71fa9d6af7ccce331a06ec6b4
  Author: Keith Packard <keithp at keithp.com>
  Date:   2020-02-18 (Tue, 18 Feb 2020)

  Changed paths:
    M snekde/Makefile
    M snekde/snekde.py

  Log Message:
  -----------
  snekde: Reformat with black. Add 'make check' rule to keep things clean

Let's keep snekde.py formatted with black.

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


  Commit: 65dc8a686633f9cc6d0707c3c875996f7842e10f
      https://github.com/keith-packard/snek/commit/65dc8a686633f9cc6d0707c3c875996f7842e10f
  Author: Keith Packard <keithp at keithp.com>
  Date:   2020-02-18 (Tue, 18 Feb 2020)

  Changed paths:
    M examples/blink.py
    M examples/hanoi.py
    M examples/morse.py
    M examples/neopixel.py
    M examples/neopixels.py
    M examples/snek-bsd.py
    M examples/snek-car.py
    M examples/snek.py
    M examples/track-light.py

  Log Message:
  -----------
  examples: Reformat with 'black'

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


  Commit: 1b67d8063dd92cca5a3dbbc7cae727673ec05ca0
      https://github.com/keith-packard/snek/commit/1b67d8063dd92cca5a3dbbc7cae727673ec05ca0
  Author: Keith Packard <keithp at keithp.com>
  Date:   2020-02-18 (Tue, 18 Feb 2020)

  Changed paths:
    M test/fail-actual-named-first.py
    M test/fail-arg-dup1.py
    M test/fail-arg-dup2.py
    M test/fail-arg-unknown.py
    M test/fail-args-missing.py
    M test/fail-formal-named-first.py
    M test/fail-interpolate-badformat.py
    M test/fail-interpolate-extra.py
    M test/fail-interpolate-missing.py
    M test/fail-scoping-no-decl.py
    M test/pass-andor.py
    M test/pass-args.py
    M test/pass-dict.py
    M test/pass-equal_is.py
    M test/pass-float.py
    M test/pass-for-array.py
    M test/pass-for-break.py
    M test/pass-for-nested.py
    M test/pass-for-range.py
    M test/pass-for-string.py
    M test/pass-get.py
    M test/pass-global.py
    M test/pass-if.py
    M test/pass-interpolate-str.py
    M test/pass-list.py
    M test/pass-math.py
    M test/pass-none.py
    M test/pass-op.py
    M test/pass-range.py
    M test/pass-scoping-global.py
    M test/pass-scoping-local.py
    M test/pass-slice.py
    M test/pass-while-break.py

  Log Message:
  -----------
  test: Reformat with black

Make the tests follow python coding conventions.

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


  Commit: d1e7d72282bc1160f325427649277825caea8c1c
      https://github.com/keith-packard/snek/commit/d1e7d72282bc1160f325427649277825caea8c1c
  Author: Keith Packard <keithp at keithp.com>
  Date:   2020-02-18 (Tue, 18 Feb 2020)

  Changed paths:
    M ao/make-product.py
    M chips/samd21/uf2conv.py
    M ports/esp32/loadable_elf_example_test.py

  Log Message:
  -----------
  Reformat python utilities with black

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


  Commit: d6603e490039df2425ab7fe1de4250c9f621ebfa
      https://github.com/keith-packard/snek/commit/d6603e490039df2425ab7fe1de4250c9f621ebfa
  Author: Keith Packard <keithp at keithp.com>
  Date:   2020-02-18 (Tue, 18 Feb 2020)

  Changed paths:
    M Makefile

  Log Message:
  -----------
  Check python formatting in 'make check'.

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


  Commit: 2b817d11c813930a748e356d90fecadedea43a37
      https://github.com/keith-packard/snek/commit/2b817d11c813930a748e356d90fecadedea43a37
  Author: Keith Packard <keithp at keithp.com>
  Date:   2020-02-18 (Tue, 18 Feb 2020)

  Changed paths:
    M test/Makefile
    A test/pass-trailing-comma.py

  Log Message:
  -----------
  test: Check trailing comma support

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


Compare: https://github.com/keith-packard/snek/compare/cec2a26b78ba...2b817d11c813


More information about the Snek mailing list