Open
Description
If the built-in proc-macro IDENT
rule is computed after regular rules are added, it could depend on a user-defined rule, let's say KEYWORD
, such that:
KEYWORD = "be" | "in" | "lambda" | "let";
would result in IDENT
matching any proc-macro
identifier except let
and lambda
.
That would make this grammar less ambiguous (e.g. for (lambda x x) y
or let x be y in (x x)
):
Expr
= Var:IDENT
| Paren:{"(" inner:Expr ")"}
| Lambda:{"lambda" var:IDENT body:Expr}
| LetIn:{"let" var:IDENT "be" init:Expr "in" body:Expr}
| Call:{callee:Expr arg:Expr}
;
To recover the old behavior, one could add a IdentOrKw = IDENT | KEYWORD;
rule.
While implementing this efficiently would be difficult at this time, proc-macro support isn't exactly fast either, as it has to work with a limited API.
Metadata
Metadata
Assignees
Labels
No labels