Re: [Factor-talk] Peg Parser Definition

2020-11-23 Thread Chris Double
On Sun, Nov 22, 2020 at 2:44 PM Alexander Ilin wrote: > 1. Is it possible to convert a word defined with EBNF: into a word > returning a parser, or to somehow extract the parser from inside it? Is there > maybe an undocumented word that could help with that, like by making a > wrapper? You c

Re: [Factor-talk] Peg Parser Definition

2020-11-22 Thread Alexander Ilin
Thanks for the [=[ suggestion, it works just as well! 22.11.2020, 19:17, "John Benediktsson" :Yes, here's how (currently depending on the implementation behavior, but this has worked for a long time). For example, in the urls.private vocabulary there's a parser for URLs, and you can get the peg par

Re: [Factor-talk] Peg Parser Definition

2020-11-22 Thread John Benediktsson
Yes, here's how (currently depending on the implementation behavior, but this has worked for a long time). For example, in the urls.private vocabulary there's a parser for URLs, and you can get the peg parser from an EBNF: word. \ parse-url "ebnf-parser" word-prop main of Most of our EBNF: w

[Factor-talk] Peg Parser Definition

2020-11-21 Thread Alexander Ilin
Hello! I'd like to use the peg.search vocab, and for that I need to pass it a parser. Most of the parsing words in peg.ebnf produce either a quotation that is immediately called inline (EBNF[[), or produce a word that calls a parser hidden inside it (EBNF:). There are only two ways to pass