regenerate boot command code

This commit is contained in:
Megan Marsh 2020-02-28 09:50:50 -08:00
parent 591b684f08
commit 66a1cdb8d2
1 changed files with 54 additions and 7 deletions

View File

@ -99,6 +99,7 @@ var g = &grammar{
pos: position{line: 14, col: 18, offset: 167}, pos: position{line: 14, col: 18, offset: 167},
val: "wait", val: "wait",
ignoreCase: false, ignoreCase: false,
want: "\"wait\"",
}, },
&labeledExpr{ &labeledExpr{
pos: position{line: 14, col: 25, offset: 174}, pos: position{line: 14, col: 25, offset: 174},
@ -238,6 +239,7 @@ var g = &grammar{
pos: position{line: 39, col: 10, offset: 819}, pos: position{line: 39, col: 10, offset: 819},
val: "-", val: "-",
ignoreCase: false, ignoreCase: false,
want: "\"-\"",
}, },
}, },
&ruleRefExpr{ &ruleRefExpr{
@ -253,6 +255,7 @@ var g = &grammar{
pos: position{line: 39, col: 25, offset: 834}, pos: position{line: 39, col: 25, offset: 834},
val: ".", val: ".",
ignoreCase: false, ignoreCase: false,
want: "\".\"",
}, },
&oneOrMoreExpr{ &oneOrMoreExpr{
pos: position{line: 39, col: 29, offset: 838}, pos: position{line: 39, col: 29, offset: 838},
@ -278,6 +281,7 @@ var g = &grammar{
pos: position{line: 43, col: 11, offset: 894}, pos: position{line: 43, col: 11, offset: 894},
val: "0", val: "0",
ignoreCase: false, ignoreCase: false,
want: "\"0\"",
}, },
&actionExpr{ &actionExpr{
pos: position{line: 43, col: 17, offset: 900}, pos: position{line: 43, col: 17, offset: 900},
@ -336,6 +340,7 @@ var g = &grammar{
pos: position{line: 51, col: 6, offset: 1065}, pos: position{line: 51, col: 6, offset: 1065},
val: "on", val: "on",
ignoreCase: true, ignoreCase: true,
want: "\"on\"i",
}, },
}, },
}, },
@ -349,6 +354,7 @@ var g = &grammar{
pos: position{line: 55, col: 7, offset: 1104}, pos: position{line: 55, col: 7, offset: 1104},
val: "off", val: "off",
ignoreCase: true, ignoreCase: true,
want: "\"off\"i",
}, },
}, },
}, },
@ -370,6 +376,7 @@ var g = &grammar{
pos: position{line: 64, col: 11, offset: 1240}, pos: position{line: 64, col: 11, offset: 1240},
val: ">", val: ">",
ignoreCase: false, ignoreCase: false,
want: "\">\"",
}, },
}, },
{ {
@ -379,6 +386,7 @@ var g = &grammar{
pos: position{line: 65, col: 13, offset: 1256}, pos: position{line: 65, col: 13, offset: 1256},
val: "<", val: "<",
ignoreCase: false, ignoreCase: false,
want: "\"<\"",
}, },
}, },
{ {
@ -391,181 +399,217 @@ var g = &grammar{
pos: position{line: 66, col: 14, offset: 1273}, pos: position{line: 66, col: 14, offset: 1273},
val: "bs", val: "bs",
ignoreCase: true, ignoreCase: true,
want: "\"bs\"i",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 66, col: 22, offset: 1281}, pos: position{line: 66, col: 22, offset: 1281},
val: "del", val: "del",
ignoreCase: true, ignoreCase: true,
want: "\"del\"i",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 66, col: 31, offset: 1290}, pos: position{line: 66, col: 31, offset: 1290},
val: "enter", val: "enter",
ignoreCase: true, ignoreCase: true,
want: "\"enter\"i",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 66, col: 42, offset: 1301}, pos: position{line: 66, col: 42, offset: 1301},
val: "esc", val: "esc",
ignoreCase: true, ignoreCase: true,
want: "\"esc\"i",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 66, col: 51, offset: 1310}, pos: position{line: 66, col: 51, offset: 1310},
val: "f10", val: "f10",
ignoreCase: true, ignoreCase: true,
want: "\"f10\"i",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 66, col: 60, offset: 1319}, pos: position{line: 66, col: 60, offset: 1319},
val: "f11", val: "f11",
ignoreCase: true, ignoreCase: true,
want: "\"f11\"i",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 66, col: 69, offset: 1328}, pos: position{line: 66, col: 69, offset: 1328},
val: "f12", val: "f12",
ignoreCase: true, ignoreCase: true,
want: "\"f12\"i",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 67, col: 11, offset: 1345}, pos: position{line: 67, col: 11, offset: 1345},
val: "f1", val: "f1",
ignoreCase: true, ignoreCase: true,
want: "\"f1\"i",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 67, col: 19, offset: 1353}, pos: position{line: 67, col: 19, offset: 1353},
val: "f2", val: "f2",
ignoreCase: true, ignoreCase: true,
want: "\"f2\"i",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 67, col: 27, offset: 1361}, pos: position{line: 67, col: 27, offset: 1361},
val: "f3", val: "f3",
ignoreCase: true, ignoreCase: true,
want: "\"f3\"i",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 67, col: 35, offset: 1369}, pos: position{line: 67, col: 35, offset: 1369},
val: "f4", val: "f4",
ignoreCase: true, ignoreCase: true,
want: "\"f4\"i",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 67, col: 43, offset: 1377}, pos: position{line: 67, col: 43, offset: 1377},
val: "f5", val: "f5",
ignoreCase: true, ignoreCase: true,
want: "\"f5\"i",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 67, col: 51, offset: 1385}, pos: position{line: 67, col: 51, offset: 1385},
val: "f6", val: "f6",
ignoreCase: true, ignoreCase: true,
want: "\"f6\"i",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 67, col: 59, offset: 1393}, pos: position{line: 67, col: 59, offset: 1393},
val: "f7", val: "f7",
ignoreCase: true, ignoreCase: true,
want: "\"f7\"i",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 67, col: 67, offset: 1401}, pos: position{line: 67, col: 67, offset: 1401},
val: "f8", val: "f8",
ignoreCase: true, ignoreCase: true,
want: "\"f8\"i",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 67, col: 75, offset: 1409}, pos: position{line: 67, col: 75, offset: 1409},
val: "f9", val: "f9",
ignoreCase: true, ignoreCase: true,
want: "\"f9\"i",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 68, col: 12, offset: 1426}, pos: position{line: 68, col: 12, offset: 1426},
val: "return", val: "return",
ignoreCase: true, ignoreCase: true,
want: "\"return\"i",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 68, col: 24, offset: 1438}, pos: position{line: 68, col: 24, offset: 1438},
val: "tab", val: "tab",
ignoreCase: true, ignoreCase: true,
want: "\"tab\"i",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 68, col: 33, offset: 1447}, pos: position{line: 68, col: 33, offset: 1447},
val: "up", val: "up",
ignoreCase: true, ignoreCase: true,
want: "\"up\"i",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 68, col: 41, offset: 1455}, pos: position{line: 68, col: 41, offset: 1455},
val: "down", val: "down",
ignoreCase: true, ignoreCase: true,
want: "\"down\"i",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 68, col: 51, offset: 1465}, pos: position{line: 68, col: 51, offset: 1465},
val: "spacebar", val: "spacebar",
ignoreCase: true, ignoreCase: true,
want: "\"spacebar\"i",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 68, col: 65, offset: 1479}, pos: position{line: 68, col: 65, offset: 1479},
val: "insert", val: "insert",
ignoreCase: true, ignoreCase: true,
want: "\"insert\"i",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 68, col: 77, offset: 1491}, pos: position{line: 68, col: 77, offset: 1491},
val: "home", val: "home",
ignoreCase: true, ignoreCase: true,
want: "\"home\"i",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 69, col: 11, offset: 1509}, pos: position{line: 69, col: 11, offset: 1509},
val: "end", val: "end",
ignoreCase: true, ignoreCase: true,
want: "\"end\"i",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 69, col: 20, offset: 1518}, pos: position{line: 69, col: 20, offset: 1518},
val: "pageup", val: "pageup",
ignoreCase: true, ignoreCase: true,
want: "\"pageUp\"i",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 69, col: 32, offset: 1530}, pos: position{line: 69, col: 32, offset: 1530},
val: "pagedown", val: "pagedown",
ignoreCase: true, ignoreCase: true,
want: "\"pageDown\"i",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 69, col: 46, offset: 1544}, pos: position{line: 69, col: 46, offset: 1544},
val: "leftalt", val: "leftalt",
ignoreCase: true, ignoreCase: true,
want: "\"leftAlt\"i",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 69, col: 59, offset: 1557}, pos: position{line: 69, col: 59, offset: 1557},
val: "leftctrl", val: "leftctrl",
ignoreCase: true, ignoreCase: true,
want: "\"leftCtrl\"i",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 69, col: 73, offset: 1571}, pos: position{line: 69, col: 73, offset: 1571},
val: "leftshift", val: "leftshift",
ignoreCase: true, ignoreCase: true,
want: "\"leftShift\"i",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 70, col: 11, offset: 1594}, pos: position{line: 70, col: 11, offset: 1594},
val: "rightalt", val: "rightalt",
ignoreCase: true, ignoreCase: true,
want: "\"rightAlt\"i",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 70, col: 25, offset: 1608}, pos: position{line: 70, col: 25, offset: 1608},
val: "rightctrl", val: "rightctrl",
ignoreCase: true, ignoreCase: true,
want: "\"rightCtrl\"i",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 70, col: 40, offset: 1623}, pos: position{line: 70, col: 40, offset: 1623},
val: "rightshift", val: "rightshift",
ignoreCase: true, ignoreCase: true,
want: "\"rightShift\"i",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 70, col: 56, offset: 1639}, pos: position{line: 70, col: 56, offset: 1639},
val: "leftsuper", val: "leftsuper",
ignoreCase: true, ignoreCase: true,
want: "\"leftSuper\"i",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 70, col: 71, offset: 1654}, pos: position{line: 70, col: 71, offset: 1654},
val: "rightsuper", val: "rightsuper",
ignoreCase: true, ignoreCase: true,
want: "\"rightSuper\"i",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 71, col: 11, offset: 1678}, pos: position{line: 71, col: 11, offset: 1678},
val: "left", val: "left",
ignoreCase: true, ignoreCase: true,
want: "\"left\"i",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 71, col: 21, offset: 1688}, pos: position{line: 71, col: 21, offset: 1688},
val: "right", val: "right",
ignoreCase: true, ignoreCase: true,
want: "\"right\"i",
}, },
}, },
}, },
@ -602,36 +646,43 @@ var g = &grammar{
pos: position{line: 75, col: 13, offset: 1745}, pos: position{line: 75, col: 13, offset: 1745},
val: "ns", val: "ns",
ignoreCase: false, ignoreCase: false,
want: "\"ns\"",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 75, col: 20, offset: 1752}, pos: position{line: 75, col: 20, offset: 1752},
val: "us", val: "us",
ignoreCase: false, ignoreCase: false,
want: "\"us\"",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 75, col: 27, offset: 1759}, pos: position{line: 75, col: 27, offset: 1759},
val: "µs", val: "µs",
ignoreCase: false, ignoreCase: false,
want: "\"µs\"",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 75, col: 34, offset: 1767}, pos: position{line: 75, col: 34, offset: 1767},
val: "ms", val: "ms",
ignoreCase: false, ignoreCase: false,
want: "\"ms\"",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 75, col: 41, offset: 1774}, pos: position{line: 75, col: 41, offset: 1774},
val: "s", val: "s",
ignoreCase: false, ignoreCase: false,
want: "\"s\"",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 75, col: 47, offset: 1780}, pos: position{line: 75, col: 47, offset: 1780},
val: "m", val: "m",
ignoreCase: false, ignoreCase: false,
want: "\"m\"",
}, },
&litMatcher{ &litMatcher{
pos: position{line: 75, col: 53, offset: 1786}, pos: position{line: 75, col: 53, offset: 1786},
val: "h", val: "h",
ignoreCase: false, ignoreCase: false,
want: "\"h\"",
}, },
}, },
}, },
@ -1095,6 +1146,7 @@ type litMatcher struct {
pos position pos position
val string val string
ignoreCase bool ignoreCase bool
want string
} }
type charClassMatcher struct { type charClassMatcher struct {
@ -1889,11 +1941,6 @@ func (p *parser) parseLitMatcher(lit *litMatcher) (interface{}, bool) {
defer p.out(p.in("parseLitMatcher")) defer p.out(p.in("parseLitMatcher"))
} }
ignoreCase := ""
if lit.ignoreCase {
ignoreCase = "i"
}
val := string(strconv.AppendQuote([]byte{}, lit.val)) + ignoreCase // wrap 'lit.val' with double quotes
start := p.pt start := p.pt
for _, want := range lit.val { for _, want := range lit.val {
cur := p.pt.rn cur := p.pt.rn
@ -1901,13 +1948,13 @@ func (p *parser) parseLitMatcher(lit *litMatcher) (interface{}, bool) {
cur = unicode.ToLower(cur) cur = unicode.ToLower(cur)
} }
if cur != want { if cur != want {
p.failAt(false, start.position, val) p.failAt(false, start.position, lit.want)
p.restore(start) p.restore(start)
return nil, false return nil, false
} }
p.read() p.read()
} }
p.failAt(true, start.position, val) p.failAt(true, start.position, lit.want)
return p.sliceFrom(start), true return p.sliceFrom(start), true
} }