Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@rajsahae
Created August 17, 2013 17:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rajsahae/6257806 to your computer and use it in GitHub Desktop.
Save rajsahae/6257806 to your computer and use it in GitHub Desktop.
Errors I get using Treetop to parse
irb(main):002:0> Parser.parse "123"
RuntimeError: Parse error at offset: 0
from /Users/rsahae/dev/badaal/lib/badaal/parser.rb:27:in `parse'
from (irb):2
from /Users/rsahae/.rvm/rubies/ruby-1.9.3-p327/bin/irb:18:in `<main>'
irb(main):003:0> Parser.parse "123.123"
=> FloatLiteral+Float2 offset=0, "123.123":
SyntaxNode offset=0, ""
SyntaxNode offset=0, "123":
SyntaxNode offset=0, "1"
SyntaxNode offset=1, "2"
SyntaxNode offset=2, "3"
SyntaxNode+Float0 offset=3, ".123":
SyntaxNode offset=3, "."
SyntaxNode offset=4, "123":
SyntaxNode offset=4, "1"
SyntaxNode offset=5, "2"
SyntaxNode offset=6, "3"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment