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

How to match against an input to rule (non-literal) string? #237

Closed
davidOSUL opened this issue Jul 27, 2020 · 1 comment
Closed

How to match against an input to rule (non-literal) string? #237

davidOSUL opened this issue Jul 27, 2020 · 1 comment

Comments

@davidOSUL
Copy link

e.g:
For matching against literal strings we can do:

pub rule matchIt() = "matchesThisLiteralString"

but is there anyway to do something like:

pub rule matchIt(x: &str)  = <matches if equals x> 
@kevinmehall
Copy link
Owner

##parse_string_literal(x) -- Example from the test suite

The ## syntax is a semi-undocumented feature that calls a method on the input string, and it passes the same arguments as the ParseLiteral::parse_string_literal method expects.

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