// Code generated by [/home/jnml/.cache/go-build/8c/8caee5a3e40c8f95ce279e06648579171345a0e2087ad04b75718db6cfa4a945-d/generator -lexstring mlToken -pkg tk9_0 <...>], DO NOT EDIT. package tk9_0 // mlToken recognizes longest ASCII lexemes. Lower IDs take precedence on same length. // // id 0: ([^$]|\\\$)* // id 1: \$([^$]|\\\$)*[^\\]\$ // id 2: \$\$([^$]|\\\$)*[^\\]\$\$ // // ID == -1 is returned when no lexeme was recognized. func mlToken(s string) (id, length int) { const endOfText = 0x110000 var pos, pos0, width, width1 int id = -1 var r, r1 rune _ = pos0 _ = r _ = r1 _ = width1 step := func(pos int) (r rune, n int) { if pos < len(s) { return rune(s[pos]), 1 } return endOfText, 0 } move := func() { pos += width if r, width = r1, width1; r != endOfText { r1, width1 = step(pos + width) } } accept := func(x rune) bool { if r == x { move() return true } return false } _ = accept accept2 := func(x rune) bool { if r <= x { move() return true } return false } _ = accept2 r, r1 = endOfText, endOfText width, width1 = 0, 0 r, width = step(pos) if r != endOfText { r1, width1 = step(pos + width) } id, length = 0, pos if accept('$') { goto l8 } if accept('\\') { goto l86 } if accept2('#') { goto l100 } if r < '%' { goto l5out } if accept2('\U0010ffff') { goto l100 } l5out: return id, length l8: if accept('$') { goto l15 } if accept('\\') { goto l59 } if accept2('#') { goto l79 } if r < '%' { goto l12out } if accept2('[') { goto l79 } if r < ']' { goto l12out } if accept2('\U0010ffff') { goto l79 } l12out: return id, length l15: if accept('$') { goto l22 } if accept('\\') { goto l31 } if accept2('#') { goto l52 } if r < '%' { goto l19out } if accept2('[') { goto l52 } if r < ']' { goto l19out } if accept2('\U0010ffff') { goto l52 } l19out: return id, length l22: id, length = 1, pos if accept('$') { goto l26 } return id, length l26: if accept('$') { goto l29 } return id, length l29: id, length = 2, pos return id, length l31: if accept('$') { goto l38 } if accept('\\') { goto l31 } if accept2('#') { goto l52 } if r < '%' { goto l35out } if accept2('[') { goto l52 } if r < ']' { goto l35out } if accept2('\U0010ffff') { goto l52 } l35out: return id, length l38: if accept('$') { goto l45 } if accept('\\') { goto l31 } if accept2('#') { goto l52 } if r < '%' { goto l42out } if accept2('[') { goto l52 } if r < ']' { goto l42out } if accept2('\U0010ffff') { goto l52 } l42out: return id, length l45: if accept('$') { goto l48 } return id, length l48: id, length = 2, pos if accept('$') { goto l29 } return id, length l52: if accept('$') { goto l45 } if accept('\\') { goto l31 } if accept2('#') { goto l52 } if r < '%' { goto l56out } if accept2('[') { goto l52 } if r < ']' { goto l56out } if accept2('\U0010ffff') { goto l52 } l56out: return id, length l59: if accept('$') { goto l66 } if accept('\\') { goto l59 } if accept2('#') { goto l79 } if r < '%' { goto l63out } if accept2('[') { goto l79 } if r < ']' { goto l63out } if accept2('\U0010ffff') { goto l79 } l63out: return id, length l66: if accept('$') { goto l73 } if accept('\\') { goto l59 } if accept2('#') { goto l79 } if r < '%' { goto l70out } if accept2('[') { goto l79 } if r < ']' { goto l70out } if accept2('\U0010ffff') { goto l79 } l70out: return id, length l73: id, length = 1, pos if accept('$') { goto l77 } return id, length l77: id, length = 1, pos return id, length l79: if accept('$') { goto l73 } if accept('\\') { goto l59 } if accept2('#') { goto l79 } if r < '%' { goto l83out } if accept2('[') { goto l79 } if r < ']' { goto l83out } if accept2('\U0010ffff') { goto l79 } l83out: return id, length l86: id, length = 0, pos if accept('$') { goto l94 } if accept('\\') { goto l86 } if accept2('#') { goto l100 } if r < '%' { goto l91out } if accept2('\U0010ffff') { goto l100 } l91out: return id, length l94: id, length = 0, pos if accept('\\') { goto l86 } if accept2('#') { goto l100 } if r < '%' { goto l97out } if accept2('\U0010ffff') { goto l100 } l97out: return id, length l100: id, length = 0, pos if accept('\\') { goto l86 } if accept2('#') { goto l100 } if r < '%' { goto l103out } if accept2('\U0010ffff') { goto l100 } l103out: return id, length id, length = 0, pos if accept('$') { goto l8 } if accept('\\') { goto l86 } if accept2('#') { goto l100 } if r < '%' { goto l111out } if accept2('\U0010ffff') { goto l100 } l111out: return id, length }