-
Notifications
You must be signed in to change notification settings - Fork 0
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
Inverse bracket expression is broken #7
Labels
bug
Something isn't working
Comments
Possibly this issue occurs when characters to be excluded are adjacent to each other. Example of characters to be adjacent to each otherLexical specification: {
"name": "test",
"entries": [
{
"kind": "not_digit",
"pattern": "[^0123456789]+"
}
]
} Result: $ echo -n '0123456789' | maleeni lex test.json
{"mode_id":1,"mode_name":"default","kind_id":0,"mode_kind_id":0,"kind_name":"","row":0,"col":0,"lexeme":"0","eof":false,"invalid":true}
{"mode_id":1,"mode_name":"default","kind_id":1,"mode_kind_id":1,"kind_name":"not_digit","row":0,"col":1,"lexeme":"1","eof":false,"invalid":false}
{"mode_id":1,"mode_name":"default","kind_id":0,"mode_kind_id":0,"kind_name":"","row":0,"col":2,"lexeme":"2","eof":false,"invalid":true}
{"mode_id":1,"mode_name":"default","kind_id":1,"mode_kind_id":1,"kind_name":"not_digit","row":0,"col":3,"lexeme":"3","eof":false,"invalid":false}
{"mode_id":1,"mode_name":"default","kind_id":0,"mode_kind_id":0,"kind_name":"","row":0,"col":4,"lexeme":"4","eof":false,"invalid":true}
{"mode_id":1,"mode_name":"default","kind_id":1,"mode_kind_id":1,"kind_name":"not_digit","row":0,"col":5,"lexeme":"5","eof":false,"invalid":false}
{"mode_id":1,"mode_name":"default","kind_id":0,"mode_kind_id":0,"kind_name":"","row":0,"col":6,"lexeme":"6","eof":false,"invalid":true}
{"mode_id":1,"mode_name":"default","kind_id":1,"mode_kind_id":1,"kind_name":"not_digit","row":0,"col":7,"lexeme":"7","eof":false,"invalid":false}
{"mode_id":1,"mode_name":"default","kind_id":0,"mode_kind_id":0,"kind_name":"","row":0,"col":8,"lexeme":"8","eof":false,"invalid":true}
{"mode_id":1,"mode_name":"default","kind_id":1,"mode_kind_id":1,"kind_name":"not_digit","row":0,"col":9,"lexeme":"9","eof":false,"invalid":false}
{"mode_id":1,"mode_name":"default","kind_id":0,"mode_kind_id":0,"kind_name":"","row":0,"col":0,"lexeme":"","eof":true,"invalid":false} Example of characters not to be adjacent to each otherLexical specification: {
"name": "test",
"entries": [
{
"kind": "not_odd",
"pattern": "[^13579]+"
}
]
} Result: $ echo -n '13579' | maleeni lex test.json
{"mode_id":1,"mode_name":"default","kind_id":0,"mode_kind_id":0,"kind_name":"","row":0,"col":0,"lexeme":"13579","eof":false,"invalid":true}
{"mode_id":1,"mode_name":"default","kind_id":0,"mode_kind_id":0,"kind_name":"","row":0,"col":0,"lexeme":"","eof":true,"invalid":false} $ echo -n '02468' | maleeni lex test.json
{"mode_id":1,"mode_name":"default","kind_id":1,"mode_kind_id":1,"kind_name":"not_odd","row":0,"col":0,"lexeme":"02468","eof":false,"invalid":false}
{"mode_id":1,"mode_name":"default","kind_id":0,"mode_kind_id":0,"kind_name":"","row":0,"col":0,"lexeme":"","eof":true,"invalid":false} |
nihei9
changed the title
Inverse expression is broken
Inverse bracket expression is broken
Apr 19, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I made the following file:
Then I got the following result:
Even though the inverse expression contains
)
, maleeni v0.6.0 recognizes)
as a valid token. The expectation is that)
will be a part of an invalid token.The text was updated successfully, but these errors were encountered: