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

Add precedence operator to sequence definition #28

Open
jvdb opened this issue Jan 14, 2013 · 1 comment
Open

Add precedence operator to sequence definition #28

jvdb opened this issue Jan 14, 2013 · 1 comment

Comments

@jvdb
Copy link
Owner

jvdb commented Jan 14, 2013

For example:

sequence
  (a > b)*

Would then mean iteration over either a and/or b, but attempt to match a first. This is especially useful when dealing with specialized instances of existing structures. Currently this is sometimes done:

sequence
  (a b c)*
  (a b d)*

When what was really intended was:

sequence
  (a b c > d)*

Note: These two are not equivalent, but that's part of the problem.

@jvdb
Copy link
Owner Author

jvdb commented Mar 25, 2013

An alternative solution is to make the order in which tokens appear significant. So the last example would then be:

sequence
  (a b c d)*

Which would then explicitly mean that d is to be attempted last.

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

1 participant