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

Support lex-style definitions #417

Open
FranklinChen opened this issue Aug 30, 2023 · 1 comment
Open

Support lex-style definitions #417

FranklinChen opened this issue Aug 30, 2023 · 1 comment

Comments

@FranklinChen
Copy link

I didn't see a way to do the following that can be done in lex:

DIGIT    [0-9]
ID       [a-z][a-z0-9]*
NUMBER {DIGIT}+"."{DIGIT}*

%%

{NUMBER} ...

so that patterns can be composed in definitions and definitions can be used in rules.

@ltratt
Copy link
Member

ltratt commented Aug 30, 2023

Yes, this isn't currently supported. Given that we currently use the Rust regex crate, if we wanted to do something like this, we'd have some interesting fun and games getting escaping right. So a basic version is pretty easy; a version with good error messages might be challenging.

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