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

ARC grammar: overlapping values Color and Pos #46

Open
pwochner opened this issue Jul 1, 2024 · 1 comment
Open

ARC grammar: overlapping values Color and Pos #46

pwochner opened this issue Jul 1, 2024 · 1 comment
Assignees

Comments

@pwochner
Copy link
Contributor

pwochner commented Jul 1, 2024

# grammar.jl
Color = |(0:9)
Pos = |(1:30)

When expanded, the grammar has a rule for each value for Color (from 0 to 9), but for Pos, the grammar only covers values 10 to 30.

We could use a tuple for Pos, but that would make the grammar very big. Can we think of a elegant solution for this?

@THinnerichs
Copy link
Member

As discussed previously, I see multiple solutions:

  1. Add units to Color: Comparisons + operations would still work.
  2. Do something ugly like
Color = Int(1) | ...

As the expression differs, this should work.

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

No branches or pull requests

2 participants