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

OR DSL method Syntax should be more consistent. #192

Closed
bd82 opened this issue Apr 30, 2016 · 1 comment
Closed

OR DSL method Syntax should be more consistent. #192

bd82 opened this issue Apr 30, 2016 · 1 comment
Labels

Comments

@bd82
Copy link
Member

bd82 commented Apr 30, 2016

currently each alternative may be specified as

{ALT: () => {...}}
{WHEN: predicate, THEN_DO: () => {...}}

Should consider replacing the THEN_DO with ALT

{WHEN: predicate, ALT: () => {...}}
  • How does this affect the Gast builder?
  • This is a pretty big breaking change... (although its better to break things now before V1.0.0...)
@bd82 bd82 changed the title OR DSL method Syntax should be more consistent OR DSL method Syntax should be more consistent. Sep 1, 2016
@bd82
Copy link
Member Author

bd82 commented Sep 1, 2016

Will Change it to:

{ALT: () => {...}}
{GATE: predicate, ALT: () => {...}}

So the ALT property is always the grammar "action" to perform.
And the GATE property has a more meaningful name.

This is a breaking change so any use of:

{WHEN: predicate, THEN_DO: () => {...}}

must be replaced with:

{GATE: predicate, ALT: () => {...}}

@bd82 bd82 added the API label Sep 1, 2016
bd82 pushed a commit that referenced this issue Sep 1, 2016
Both The variant with Gates and Without Gates
Will use the "ALT" property for the grammar action.
The "GATE" property now replaces the "WHEN" property as it
more explicitly specifies the intent.

Fixes #192
@bd82 bd82 closed this as completed in #271 Sep 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant