ref: a71988c710b2aaa5cf23fe1fedc52d3d7fc4b55d
parent: d8e7409cd405de9a996e44ac184e5b8cd83c65c6
author: Ori Bernstein <ori@eigenstate.org>
date: Fri Dec 19 15:13:38 EST 2014
Commment the parser a bit.
--- a/parse.myr
+++ b/parse.myr
@@ -47,22 +47,31 @@
-> true
}
+/* bintarget: myrtarget */
const bintarget = {p
p.targs = std.slpush(p.targs, `Bin myrtarget(p, "bin"))
}
+/* libtarget: myrtarget */
const libtarget = {p
p.targs = std.slpush(p.targs, `Lib myrtarget(p, "lib"))
}
+/* subtarget : anontarget */
const subtarget = {p
p.targs = std.slpush(p.targs, `Sub anontarget(p, "sub"))
}
+/* mantarget: anontarget */
const mantarget = {p
p.targs = std.slpush(p.targs, `Man anontarget(p, "man"))
}
+
+/*
+myrtarget: name '=' inputlist ';;'
+ | name attrlist = inputlist ';;'
+*/
const myrtarget = {p, targ
var name, inputs, libdeps, attrs
var ldscript, runtime, inst, incpath
@@ -135,6 +144,7 @@
])
}
+/* anontarget: '=' namelist ';;' */
const anontarget = {p, targ
var inputs
@@ -155,6 +165,15 @@
-> inputs
}
+/*
+attrlist: attrs '}'
+
+attrs : EMPTY
+ | attrs attr
+
+attr : name
+ | name '=' name
+*/
const attrlist = {p
var al
@@ -186,6 +205,13 @@
;;
}
+/*
+inputlist: EMPTY
+ | inputlist input
+
+input : word
+ | "lib" word
+*/
const inputlist = {p
var wl, libs
@@ -209,6 +235,7 @@
;;
}
+/* wordlist: EMPTY | wordlist word */
const wordlist = {p
var wl
@@ -226,6 +253,7 @@
;;
}
+/* word: /wordchar*/
const word = {p : parser#
var c, r, n
var start