brownplt / pyret-docs

The documentation for Pyret.
9 stars 18 forks source link

Mention "no preceding space" rule for left paren in function declaration and lambda expressions #76

Open muzimuzhi opened 11 months ago

muzimuzhi commented 11 months ago

Currently this rule is mentioned in

But Pyret will also complain if a space exists before opening parenthesis in

This also seems to suggest, that the grammar rule for ‹args› (line 916 below) https://github.com/brownplt/pyret-docs/blob/e54e93331412615b27f8f5b3d54826e70a6f86a7/src/lang/forms.scrbl#L911-L916 should be updated to

args: PARENNOSPACE [list-arg-elt* binding] RPAREN

As a reference, in pyret-grammar.bnf in pyret-lang repo, ‹args› has grammar rule

args: (PARENNOSPACE|PARENAFTERBRACE) [binding (COMMA binding)*] RPAREN