-
Notifications
You must be signed in to change notification settings - Fork 110
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
Cannot use '[]' with EBNF? #57
Comments
Optional EBNF rules don't work in the way that you suggest. Typical code would look like this:
If you refer to |
OK, Got it. I noticed the tuple and used it to get what I needed after opening this issue.
|
The thing that confuses me is that the pipe character is used in one of the scripts in the "tests" folder in the repository. |
If you want to write a rule for
Then write it as
As for docs, your request is noted, but nothing more. This is a side project. Sometimes I work on it. Sometimes not. There are many other parsing libraries available. |
Could you list some good libraries please? I've used your PLY library and its been enough for me so far, but I'd like to know if there are any other nice ones to use. 😀 |
this project, sly, is newer and better than PLY, try it! |
I tried to write this formula for a variable or a reference of element in one array:
As well known, strings in '[]' is optional for this rule, but I try to get length of it, the length always is 3: if I Input
$i
as a variable not ref, thep[2]
will be(None, None, None)
as a tuple.How to solve it? I think the length would be
5
if my input looks like$x[0]
and length would be2
if my input looks like$i
The text was updated successfully, but these errors were encountered: