initial (hacky af)

This commit is contained in:
2017-02-24 18:38:35 +01:00
commit ffeacdcb6c
8 changed files with 267 additions and 0 deletions

13
examples/golike.py Normal file
View File

@@ -0,0 +1,13 @@
import gll
ws = gll.many(gll.whitespace)
function = function
package_name = gll.seq(gll.skip(gll.string("package")), gl.skip(ws),
gll.regex(".*$"), tag="package_name")
package = gll.seq(package_name, gll.many(function, tag="package_body"),
tag="package")
parser = gll.all(package)