-
Notifications
You must be signed in to change notification settings - Fork 11
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
SyntaxError: Invalid regular expression returned when parsing #21
Comments
@erezsh could you please take a look at this issue? |
Sorry, I had a few busy weeks. I'll give it a look. |
This happens because Javascript's regex implementation doesn't support all the features that Python has. This might take a bit longer to fix. Meanwhile, a possible work around is to change FUNCNAME: (MIN|MAX|SUM|AVG|COUNT|NUNIQUE) to funcname: (MIN|MAX|SUM|AVG|COUNT|NUNIQUE) |
Thank you for the response. Looking forward to your fix. :) |
Do you mean to edit the generated parser.js? However, I could not find the string. FUNCNAME: (MIN|MAX|SUM|AVG|COUNT|NUNIQUE) |
No... edit the grammar! |
Got it. Thanks! Let me try. |
yeah, updating the grammar from |
The "fix" is most likely going to be preventing users from doing what you were trying to do and throwing an error instead. I don't know if there is a way to make it work in Javascript. At least, without implementing part of the regex mechanism myself. |
I got it. Thanks. Would you mind to release a version which contains other fixes first? |
Grammar file: https://github.com/opencybersecurityalliance/kestrel-lang/blob/develop/src/kestrel/syntax/kestrel.lark
Generated parser:
kestrelParser.js.zip
When parsing this statement
procs2 = GET process abc
, the parser throws the exception like below which is not caught by parser.Code
Expected:
This kind of error can be handled by the parser, so we can get the parsing tree and the error info like
Unexpected character
orUnexpected Token
.The text was updated successfully, but these errors were encountered: