-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed as not planned
Closed as not planned
Copy link
Labels
Description
Feature or enhancement
Proposal:
The current grammar for slash_no_default
has two alternatives:
slash_no_default[asdl_arg_seq*]:
| a[asdl_arg_seq*]=param_no_default+ '/' ',' { a }
| a[asdl_arg_seq*]=param_no_default+ '/' &')' { a }
I am proposing changing the grammar to:
slash_no_default[asdl_arg_seq*]:
| a[asdl_arg_seq*]=param_no_default+ '/' (',' | &')' { (void *)1 }) { a }
The same change can be made to the slash_with_default
rule.
1
is meant as true
and cast to void *
is needed because peg-generator
always creates an artificial rule for a group with a return type void *
.
This change would mean less backtracking will be made since param_no_default+
would be parsed only once.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response