parslet
parslet copied to clipboard
A small PEG based parser library. See the Hacking page in the Wiki as well.
Fixes to allow my use case of parsing 500mb+ file, with huge blocks of content that do not need parsing, but was taking forever to do without. - Reparse for...
It seems currently the precedences in `infix_expression` need to be > 0; when you use 0 for an operator, it fails to parse it correctly. As far as I can...
Normally when you use `as` on `repeat`, the matched string will be in the result hash: ``` ruby str('a').repeat.as(:b).parse('aaaaa') # => {:b=>"aaaaa"@0} ``` However when the input string is empty,...
If you use `scope`, context cache will hit incorrectly. Bug reproduction example: ```ruby require 'parslet' class Mini < Parslet::Parser NewLine="\n" root(:root) rule(:root) { init >> (exp >> nl).repeat } rule(:init)...
I have a use case where I end up creating a custom rule like.. ``` def words %w[longestword longword word w].map {|w| str(w)}.reduce(:|) end ``` Where the list of words...
Having a way to mark certain keys as optional could go a long way towards reducing mostly redundant transform rules. Here's a simple example to show what I'm asking for....
Parslet grammers are littered with whitespace checks, making them harder to read. Leaving them out fails to parse valid things properly. Take the javascript parser as an example: https://github.com/matthewd/capuchin/blob/d47f4b19eb888b6a4fc5428d3d1fdfcdb551b183/lib/capuchin/parser.rb There...
I have a web app using my [Flooph](https://github.com/Phrogz/Flooph) gem, which is a class inheriting from `Parslet::Parser`. When I get certain web app errors, it tries to `inspect` my class, resulting...