$ luarocks install --server=https://luarocks.org/dev leftry
This library is for creating and composing parsers.
For example:
```
local grammar = require("leftry")
local factor = grammar.factor
local span = grammar.span
local A = factor("A", function(A) return
span(A, "1"), "1"
end)
local B = factor("B", function(B) return
span(B, "2"), A
end)
print(B("111122222", 1))
```
This creates a parser `B` that can parse the string "111122222".
Versions
Dependencies
lua >= 5.2