-
Notifications
You must be signed in to change notification settings - Fork 452
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
Jison's advanced grouping options not working #340
Comments
Side note: macro's add capturing groups of their own, so the index number is not 'immediately obvious' when you employ lex macros in your lexer rule, e.g. |
Thanks @GerHobbelt. But how can i use I also noticed that |
Certainly. In the lexer rule which you want to process, you can re-assign The next few bits are valid for my jison fork; it has an extended lexer API and a few bug fixes here and there, compared to vanilla (see #338). Here are a few examples extracted from a production grammar, which showcase several lexer rule action code chunks using the lexer APIs; this stuff should give you plenty of ammo to tackle your challenge, I expect: Showcasing overwriting
|
Wow! You're a lifesaver! I'll try these features. Since this isn't an error but a lack of vanilla jison feature, i'll close this issue. Thanks again @GerHobbelt !! Keep doing this excelent work! |
Hi there, i'm trying to parsing an input with regex using a non-capturing parenthesis (?:). However Jison's lexer is getting the whole match while it should get only the group match. Take a look at the following code:
this.yytext += match[0];
The length of match array is 2 and the group match is at position 1.
The input that i'm trying to parse is
and i need to get only the 'request' portion.
My regex is
:([^\r\n]+)(?:\-\-color\s+\#[0-9A-Za-z]+)
and the regex generated by Jison is/^(?:([^\r\n]+)(?:--color\s+#[0-9A-Za-z]+))/
Am i missing something here? I've already readed the Deviations From Flex Bison topic.
The text was updated successfully, but these errors were encountered: