parboiled2
parboiled2 copied to clipboard
A macro-based PEG parser generator for Scala 2.10+
I would like to suggest the implementation of the parsing elements of this project to include serializable characteristics from scratch. this would enable the parsers defined with parboiled to used...
There is a bug in (the application of) the `TailSwitch` logic, which causes certain parsers to compile when they shouldn't: ``` scala class Par extends Parser { def A: Rule1[Any]...
`parboiled2` type system should catch errors in a grammar as follows: ``` scala class SomeParser extends Parser { def test = rule { push("x") ~ (a | b) } def...
There are cases when error collecting is not necessary. A user just'd like to know if parsing was successful or not. In meantime, error collecting is time consuming. I suggest...
``` scala import org.parboiled2._ def parse[P Rule1[A]) = f(p).run() ``` Error message in macro expansion: ``` Illegal .run() call base: f.apply(p) ```
Compile fails with message: `Error:scalac: unexpected UnApply collection.this.Seq.unapplySeq[String]() ((single @ _))` ``` scala import org.parboiled2.{Rule1, CharPredicate, ParserInput, Parser} class SeqMatch(val input: ParserInput) extends Parser { def id: Rule1[String] = rule...
Rather than matching ``` "foo" | "bar" | "baz" ``` with the usual "first match" strategy we can optimize the whole match at compile time and produce a simple DFA...
Validation of the following triple with Cheló̱na (https://github.com/JuPfu/chelona) , a Parboiled2 based Scala Parser for the W3C RDF 1.1 Turtle Language **http://www.w3.org/2013/TurtleTests/s http://www.w3.org/2013/TurtleTests/p 123.abc .** results in the following error...
The `|` operator requires that the types of the two rules being "or-ed" are "compatible". In most cases this is what you want, i.e. `(a: Rule1[Int]) | (b: Rule1[String])` shouldn't...
Currently, parboiled2 uses two complementary compile-time mechanisms to make sure a parser is well-formed: - first, pretty advanced type-level logic is used to make sure that parsers were combined correctly...