Closed jillyj closed 2 years ago
Yes, you can disable that feature with get_parser({keep_all_tokens: true})
I've enabled the option like below
const parser = get_parser({keep_all_tokens: true});
But I didn't get the keywords presented.
Oh, I got it. I have to set the option when I generated the parser using lark-js package like below
lark-js kestrel.lark -o kestrel_parser.js --keep_all_tokens
instead of passing the argument in the get_parser
function. Thanks.
Huh, I guess that's right. Sorry, my bad.
Grammar file: https://github.com/opencybersecurityalliance/kestrel-lang/blob/develop/src/kestrel/syntax/kestrel.lark Based on the grammar
The
from
andwhere
are keywords forget
command. However, when I parsed this statement"procs2 = GET process FROM procs WHERE [process:pid = 10578]"
The parsed tree is as below which does not contain thefrom
andwhere
keywords. Is there any options I can pass to the parser to get those keywords in the parse tree?