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

nested groups fails to parse #93

Closed
aeb-dev opened this issue Nov 10, 2018 · 4 comments
Closed

nested groups fails to parse #93

aeb-dev opened this issue Nov 10, 2018 · 4 comments

Comments

@aeb-dev
Copy link

aeb-dev commented Nov 10, 2018

Language => Expr: (STRING (COMMA [d] STRING)*)?
Error => "unexpected "(" (LPAREN) at line 1, column 15.expecting IDENTIFIER, unexpected "(" (LPAREN) at line 1, column 15.expecting DISCARD, unexpected "(" (LPAREN) at line 1, column 15.expecting RPAREN, unexpected "(" (LPAREN) at line 1, column 15.expecting DISCARD, unexpected "(" (LPAREN) at line 1, column 15.expecting IDENTIFIER, unexpected "(" (LPAREN) at line 1, column 15.expecting DISCARD, unexpected "(" (LPAREN) at line 1, column 15.expecting RPAREN, unexpected "(" (LPAREN) at line 1, column 15.expecting DISCARD, unexpected "(" (LPAREN) at line 1, column 15.expecting IDENTIFIER, unexpected "(" (LPAREN) at line 1, column 15.expecting DISCARD, unexpected "(" (LPAREN) at line 1, column 15.expecting RPAREN, unexpected "(" (LPAREN) at line 1, column 15.expecting DISCARD, unexpected "(" (LPAREN) at line 1, column 15.expecting IDENTIFIER, unexpected "(" (LPAREN) at line 1, column 15.expecting DISCARD, unexpected "(" (LPAREN) at line 1, column 15.expecting DISCARD, unexpected "(" (LPAREN) at line 1, column 15.expecting RPAREN, unexpected "(" (LPAREN) at line 1, column 15.expecting IDENTIFIER, unexpected "(" (LPAREN) at line 1, column 15.expecting DISCARD, unexpected "(" (LPAREN) at line 1, column 15.expecting RPAREN, unexpected "(" (LPAREN) at line 1, column 15.expecting DISCARD, unexpected "(" (LPAREN) at line 1, column 15.expecting IDENTIFIER, unexpected "(" (LPAREN) at line 1, column 15.expecting DISCARD, unexpected "(" (LPAREN) at line 1, column 15.expecting RPAREN, unexpected "(" (LPAREN) at line 1, column 15.expecting DISCARD, unexpected "(" (LPAREN) at line 1, column 15.expecting IDENTIFIER, unexpected "(" (LPAREN) at line 1, column 15.expecting DISCARD, unexpected "(" (LPAREN) at line 1, column 15.expecting RPAREN, unexpected "(" (LPAREN) at line 1, column 15.expecting DISCARD, unexpected "(" (LPAREN) at line 1, column 15.expecting IDENTIFIER, unexpected "(" (LPAREN) at line 1, column 15.expecting DISCARD, unexpected "(" (LPAREN) at line 1, column 15.expecting DISCARD, unexpected "(" (LPAREN) at line 1, column 15.expecting RPAREN, "

when I change language to this: Expr: (STRING COMMA [d] STRING)?
no problem occurs

Am I doing something wrong or nested groups are not supported?

@b3b00
Copy link
Owner

b3b00 commented Nov 10, 2018

hi @Mrmumu, first glad to see that you looked at CSLY.
for now nested groups are supported. And I have no plan to support it any soon as I son't see any usefull use case.
for your specific case the best solution is I guess :

Expr : OptinnalExpr ?
OptionnalExpr: STRING (COMMA [d] STRING)*

May I ask you what you arelooking at in CSLY ?
Are you planning to use it for any special purpose ?

@b3b00
Copy link
Owner

b3b00 commented Nov 10, 2018

The repeated error annoy me so I will look at it more precisely.

@aeb-dev
Copy link
Author

aeb-dev commented Nov 10, 2018

for now nested groups are supported. And I have no plan to support it any soon as I son't see any usefull use case.

You mean are not supported I think.

Yes, I have solved it just like that:)

I was going to send an email to you actually, after I have finished the core of my project.

I am trying to implement XPath support for .net core. Right now, .net core only support XPath 1.0 but there is already XPath 3.1 recommendation on W3C. I'm trying to implement a lexer, parser for this grammar by using your project. There are other approaches but I would like to use the published grammar.

I have searched other lexer, parser approaches but your "embeddable" solution got me^^

@b3b00
Copy link
Owner

b3b00 commented Nov 10, 2018

Great project that tout have! I am happy that the "embeddedable" feature of CSLY got you. It was my main concern when I started it. Glad to see that I am not tottaly wrong.

@b3b00 b3b00 closed this as completed Nov 11, 2018
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