Re: [Factor-talk] EBNF peg parser ensuring full parse

2017-01-17 Thread Chris Double
On Wed, Jan 18, 2017 at 4:24 AM, Jon Harper wrote: > > Should we add words to do this more easily ? > maybe > : parse* ( string parser -- ast remaining ) > : parse-all ( string parser -- ast ) ! throws when remaining not empty > > Maybe EBNF: can define several words ?

[Factor-talk] EBNF peg parser ensuring full parse

2017-01-17 Thread Jon Harper
Hi list, when using the peg.* parsing words to parse a sequence of elements, what is the best way to detect invalid input ? By default the parsing stops when rules don't match (end of input, or bad input), For example, consider the following case: "abaXbba" [EBNF rule= ("a" | "b")* EBNF] ! V{ "a"