Closed ghost closed 10 years ago
PEG != regular expressions
You assume that 'any.repeat' will stop repeating before the (ending) quote, which it doesn't. It consumes all of your string, leaving nothing for the ending quote
. (aka 'greedy') So no, that's not a bug. Please look at https://github.com/kschiess/parslet/blob/master/example/string_parser.rb for directions.
I'm working on a shell language that has strings as a data type and can't get my algorithim to work. I chose
quote >> any.repeat >> quote
which should translate toQUOTE .*QUOTE
and out puts in the parser as(QUOTE .{0, } QUOTE)
I'm convinced this should work so I'm reporting this as a bug. Any work-around suggestions or corrections if I'm wrong?