Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Simplify argument-list syntax. #589

Closed
nigelmegitt opened this issue Jan 25, 2018 · 5 comments
Closed

Simplify argument-list syntax. #589

nigelmegitt opened this issue Jan 25, 2018 · 5 comments

Comments

@nigelmegitt
Copy link
Contributor

Looks like a typo in the syntax for argument-list: the one of the terms is argument-list rather than <expression>.

Currently:

argument-list
  : <expression>
  | argument-list <lwsp>? "," <lwsp>? <expression>

Should probably be:

argument-list
  : <expression>
  | <expression> <lwsp>? "," <lwsp>? <expression>
@nigelmegitt
Copy link
Contributor Author

By the way, if the recursion here was intended, so that the list could be unbounded, then it should be:

argument-list
  : <expression>
  | <expression> (<lwsp>? "," <lwsp>? <expression>)+

or even more simply:

argument-list
  : <expression> (<lwsp>? "," <lwsp>? <expression>)*

@nigelmegitt
Copy link
Contributor Author

I noticed also that this problem is duplicated many times over in <expression> where for example logical-or-expression is defined recursively in terms of itself.

@skynavga
Copy link
Collaborator

@nigelmegitt the recursion is intended; however, I will address your comments in the PR

@skynavga skynavga changed the title argument-list syntax references itself Simplify argument-list syntax. Jan 25, 2018
@skynavga skynavga self-assigned this Jan 25, 2018
@skynavga skynavga added this to the Editor's CR Work List milestone Jan 25, 2018
@skynavga
Copy link
Collaborator

The PR (#610) does not "simplify" any of the additional @condition expressions, since that would make the syntax more complex and since the current syntax is consistent with the formal syntax of other expression languages, e.g., see ECMA-262 - Grammar Summary - Expressions, upon which I based the current syntax.

@nigelmegitt
Copy link
Contributor Author

OK, good to know the recursion is intended. I found it slightly mind-bending working through all the condition expressions and persuading myself that in the end they worked, but now my mind is bent, no need to try straightening it out again. In other words, I'm okay with that.

skynavga added a commit that referenced this issue Feb 7, 2018
…sions

Simplify argument-list expression (#589).
@skynavga skynavga removed their assignment Feb 7, 2018
@skynavga skynavga added pr merged and removed pr open labels Feb 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants