Open
Description
While trying one grammar I found what seems to be a bug with the combination of a dictionary for keywords and %whitespace
see bellow examples and outputs, when not using %whitespace
it works as expected.
Maybe I'm missing something here ?
START <-
(ID / CREATE / DELETE)*
CREATE <- "create"
DELETE <- "delete"
KeyWord <- (
"create"
| "delete"
) !IdCharTail
IdCharTail <- [A-Za-z0-9_]
ID <- !KeyWord <[A-Za-z_] IdCharTail*>
%whitespace <- [ \t\r\n]*
Input:
I will create a deleter to delete words
Output:
+ START
- ID (I)
- ID (will)
- ID (create)
- ID (a)
- ID (deleter)
- ID (to)
- ID (delete)
- ID (words)
Expected output:
+ START
- ID (I)
- ID (will)
- CREATE (create)
- ID (a)
- ID (deleter)
- ID (to)
- DELETE (delete)
- ID (words)
If we don't use %whitespcae
:
START <-
(ID / CREATE / DELETE / _)*
CREATE <- "create"
DELETE <- "delete"
KeyWord <- (
"create"
| "delete"
) !IdCharTail
IdCharTail <- [A-Za-z0-9_]
ID <- !KeyWord <[A-Za-z_] IdCharTail*>
~_ <- [ \t\r\n]+
Output:
+ START
- ID (I)
- ID (will)
- CREATE (create)
- ID (a)
- ID (deleter)
- ID (to)
- DELETE (delete)
- ID (words)
Metadata
Metadata
Assignees
Labels
No labels