Skip to content

Latest commit

 

History

History
21 lines (13 loc) · 478 Bytes

File metadata and controls

21 lines (13 loc) · 478 Bytes

Lua Table Parser

It parses Lua tables into Ruby hashes without actually executing any Lua.

Based on Lars Christensen's Lua object Treetop grammar.

Example

LuaTableParser.new.parse_table("{ a = "b" }") # => { 'a' => 'b' }

Known limitations

  • Can't parse '' or [[]] delimited strings.
  • Input must be wrapped in {}s (i.e. mytable = { ... } won't parse).

Todo

  • Unit tests
  • Work on above limitations