@@ -11,7 +11,7 @@ func root(l *lexer) stateFn {
11
11
case r == eof :
12
12
l .emitEOF ()
13
13
return nil
14
- case isSpace (r ):
14
+ case IsSpace (r ):
15
15
l .ignore ()
16
16
return root
17
17
case r == '\'' || r == '"' :
@@ -36,7 +36,7 @@ func root(l *lexer) stateFn {
36
36
case r == '.' :
37
37
l .backup ()
38
38
return dot
39
- case isAlphaNumeric (r ):
39
+ case IsAlphaNumeric (r ):
40
40
l .backup ()
41
41
return identifier
42
42
default :
@@ -67,18 +67,14 @@ func (l *lexer) scanNumber() bool {
67
67
}
68
68
}
69
69
l .acceptRun (digits )
70
- end := l .end
71
- loc := l .loc
72
- prev := l .prev
70
+ loc , prev , end := l .loc , l .prev , l .end
73
71
if l .accept ("." ) {
74
72
// Lookup for .. operator: if after dot there is another dot (1..2), it maybe a range operator.
75
73
if l .peek () == '.' {
76
74
// We can't backup() here, as it would require two backups,
77
75
// and backup() func supports only one for now. So, save and
78
76
// restore it here.
79
- l .end = end
80
- l .loc = loc
81
- l .prev = prev
77
+ l .loc , l .prev , l .end = loc , prev , end
82
78
return true
83
79
}
84
80
l .acceptRun (digits )
@@ -88,7 +84,7 @@ func (l *lexer) scanNumber() bool {
88
84
l .acceptRun (digits )
89
85
}
90
86
// Next thing mustn't be alphanumeric.
91
- if isAlphaNumeric (l .peek ()) {
87
+ if IsAlphaNumeric (l .peek ()) {
92
88
l .next ()
93
89
return false
94
90
}
@@ -110,7 +106,7 @@ func identifier(l *lexer) stateFn {
110
106
loop:
111
107
for {
112
108
switch r := l .next (); {
113
- case isAlphaNumeric (r ):
109
+ case IsAlphaNumeric (r ):
114
110
// absorb
115
111
default :
116
112
l .backup ()
0 commit comments