Menu

#30 whitespace not acting as expected wrt newline

v1.0_(example)
open
nobody
whitespace (1)
5
2014-01-01
2014-01-01
No

The behavior of 'whitespace' seems to be different for spaces and for newlines. Using the following grammar, I'm seeing some weird behavior:

$ cat k.g
A: 'a' 'b' 'c';
whitespace: "[ \n]
";

now build grammar and parser using the default options (make_dparser k.g)

$ echo "a bc" | ./parser
success
$ echo -e "a\nbc" | ./parser
:2: syntax error after 'a'

It seems to me to be a bug, that the parser doesn't expect the newline after 'a'. I'm not sure how to work around this either. Any help would be appreciated!

I've attached the output of running make_dparser.

1 Attachments

Discussion


Log in to post a comment.