Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Implement a more complete parameter list grammar #8

Open
arnsholt opened this issue May 22, 2015 · 1 comment
Open

Implement a more complete parameter list grammar #8

arnsholt opened this issue May 22, 2015 · 1 comment

Comments

@arnsholt
Copy link
Owner

The reference grammar is kind of tangled in this particular area, but I think the actual grammar goes something like this:

parameter_list: <positionals>? <positional_slurpy>? <nameds>? <named_slurpy>?

Where positionals is further constrained to not allow arguments without defaults once an argument with a default has been seen, and a positional slurpy can be either an identifier prefixed by * or just a literal star (signifying the end of the positional list without a slurpy).

There may be some further shenanigans required to be able to pass positionals by name and such, but this should at least get us a lot closer than we currently are.

@arnsholt
Copy link
Owner Author

Incidentally, a nice way to test named arguments and slurpies would be to get enough of the scaffolding in place to implement a better print, with arbitrary arguments and the sep and end arguments.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant