Always set tokenUpper when setting token (#403)
This commit is contained in:
parent
b4e7237e90
commit
574f29b9d6
7
scan.go
7
scan.go
|
@ -627,6 +627,7 @@ func zlexer(s *scan, c chan lex) {
|
||||||
if stri > 0 {
|
if stri > 0 {
|
||||||
l.value = zString
|
l.value = zString
|
||||||
l.token = string(str[:stri])
|
l.token = string(str[:stri])
|
||||||
|
l.tokenUpper = strings.ToUpper(l.token)
|
||||||
l.length = stri
|
l.length = stri
|
||||||
debug.Printf("[4 %+v]", l.token)
|
debug.Printf("[4 %+v]", l.token)
|
||||||
c <- l
|
c <- l
|
||||||
|
@ -663,6 +664,7 @@ func zlexer(s *scan, c chan lex) {
|
||||||
owner = true
|
owner = true
|
||||||
l.value = zNewline
|
l.value = zNewline
|
||||||
l.token = "\n"
|
l.token = "\n"
|
||||||
|
l.tokenUpper = l.token
|
||||||
l.length = 1
|
l.length = 1
|
||||||
l.comment = string(com[:comi])
|
l.comment = string(com[:comi])
|
||||||
debug.Printf("[3 %+v %+v]", l.token, l.comment)
|
debug.Printf("[3 %+v %+v]", l.token, l.comment)
|
||||||
|
@ -696,6 +698,7 @@ func zlexer(s *scan, c chan lex) {
|
||||||
}
|
}
|
||||||
l.value = zNewline
|
l.value = zNewline
|
||||||
l.token = "\n"
|
l.token = "\n"
|
||||||
|
l.tokenUpper = l.token
|
||||||
l.length = 1
|
l.length = 1
|
||||||
debug.Printf("[1 %+v]", l.token)
|
debug.Printf("[1 %+v]", l.token)
|
||||||
c <- l
|
c <- l
|
||||||
|
@ -740,6 +743,7 @@ func zlexer(s *scan, c chan lex) {
|
||||||
if stri != 0 {
|
if stri != 0 {
|
||||||
l.value = zString
|
l.value = zString
|
||||||
l.token = string(str[:stri])
|
l.token = string(str[:stri])
|
||||||
|
l.tokenUpper = strings.ToUpper(l.token)
|
||||||
l.length = stri
|
l.length = stri
|
||||||
|
|
||||||
debug.Printf("[%+v]", l.token)
|
debug.Printf("[%+v]", l.token)
|
||||||
|
@ -750,6 +754,7 @@ func zlexer(s *scan, c chan lex) {
|
||||||
// send quote itself as separate token
|
// send quote itself as separate token
|
||||||
l.value = zQuote
|
l.value = zQuote
|
||||||
l.token = "\""
|
l.token = "\""
|
||||||
|
l.tokenUpper = l.token
|
||||||
l.length = 1
|
l.length = 1
|
||||||
c <- l
|
c <- l
|
||||||
quote = !quote
|
quote = !quote
|
||||||
|
@ -775,6 +780,7 @@ func zlexer(s *scan, c chan lex) {
|
||||||
brace--
|
brace--
|
||||||
if brace < 0 {
|
if brace < 0 {
|
||||||
l.token = "extra closing brace"
|
l.token = "extra closing brace"
|
||||||
|
l.tokenUpper = l.token
|
||||||
l.err = true
|
l.err = true
|
||||||
debug.Printf("[%+v]", l.token)
|
debug.Printf("[%+v]", l.token)
|
||||||
c <- l
|
c <- l
|
||||||
|
@ -799,6 +805,7 @@ func zlexer(s *scan, c chan lex) {
|
||||||
if stri > 0 {
|
if stri > 0 {
|
||||||
// Send remainder
|
// Send remainder
|
||||||
l.token = string(str[:stri])
|
l.token = string(str[:stri])
|
||||||
|
l.tokenUpper = strings.ToUpper(l.token)
|
||||||
l.length = stri
|
l.length = stri
|
||||||
l.value = zString
|
l.value = zString
|
||||||
debug.Printf("[%+v]", l.token)
|
debug.Printf("[%+v]", l.token)
|
||||||
|
|
Loading…
Reference in New Issue