[Snek] [keith-packard/snek] 96f13e: chips/avr: Remove sign support from strtof

Keith Packard noreply at github.com
Thu Jun 27 11:05:43 PDT 2019


  Branch: refs/heads/master
  Home:   https://github.com/keith-packard/snek
  Commit: 96f13e4ae45838df36d3f1e9309be3638dd5eadd
      https://github.com/keith-packard/snek/commit/96f13e4ae45838df36d3f1e9309be3638dd5eadd
  Author: Keith Packard <keithp at keithp.com>
  Date:   2019-06-27 (Thu, 27 Jun 2019)

  Changed paths:
    M chips/avr/strtod.c

  Log Message:
  -----------
  chips/avr: Remove sign support from strtof

Snek never passes leading + or - to strtof, remove
support to save space.

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


  Commit: ad2e91df43b94632c48230c98814627add98b80e
      https://github.com/keith-packard/snek/commit/ad2e91df43b94632c48230c98814627add98b80e
  Author: Keith Packard <keithp at keithp.com>
  Date:   2019-06-27 (Thu, 27 Jun 2019)

  Changed paths:
    M snek-error.c
    M snek-func.c
    M snek-gram.ll
    M snek-parse.c
    M snek.h
    M test/Makefile
    A test/arg-dup1.py
    A test/arg-dup2.py
    A test/arg-unknown.py
    A test/args-missing.py
    A test/args.py

  Log Message:
  -----------
  Fix argument handling

Python has two kinds of formals: required and optional.
Python has two kinds of actuals: positional and named.

required formals and positional actuals use the similar syntax (no '=')
optional formals and named actuals also use similar syntax (they have '=').

Either kind of formal can be passed using either kind of actual.

The previous snek code only allowed required formals to be passed as
positional actuals and optional formals to be passed as named
actuals. It also allowed declaration of *new* locals in the function
scope by passing an actual by name using a name other than one of the
formals.

Changes:

 1) either required or optional formals can be assigned by name
 2) either required or optional formals can be assigned by position
 3) required formals must be passed
 4) names other than one of the formals cannot be used as by-name actuals

This change also limits the number of formals for any function to 255.

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


Compare: https://github.com/keith-packard/snek/compare/b0b74c752e5a...ad2e91df43b9


More information about the Snek mailing list