fix names that start with numbers

master
Jordan Orelli 10 years ago
parent 1369ea16a1
commit 36690e10ae

@ -358,7 +358,7 @@ func lexNameOrString(l *lexer) stateFn {
case r == eof: case r == eof:
l.emit(t_string) l.emit(t_string)
return nil return nil
case unicode.IsGraphic(r): case unicode.IsPrint(r):
l.keep(r) l.keep(r)
return lexNameOrString return lexNameOrString
default: default:
@ -386,7 +386,7 @@ func lexVariable(l *lexer) stateFn {
case r == eof: case r == eof:
l.emit(t_variable) l.emit(t_variable)
return nil return nil
case unicode.IsGraphic(r): case unicode.IsPrint(r):
l.keep(r) l.keep(r)
return lexVariable return lexVariable
default: default:
@ -451,7 +451,7 @@ func lexDuration(l *lexer) stateFn {
if err == nil { if err == nil {
l.emit(t_duration) l.emit(t_duration)
} else { } else {
l.emit(t_string) l.emit(t_name)
} }
l.keep(r) l.keep(r)
l.emit(t_object_separator) l.emit(t_object_separator)
@ -476,7 +476,7 @@ func lexDuration(l *lexer) stateFn {
l.emit(t_string) l.emit(t_string)
} }
return nil return nil
case unicode.IsGraphic(r): case unicode.IsPrint(r):
l.keep(r) l.keep(r)
return lexDuration return lexDuration
default: default:

@ -0,0 +1 @@
mix_string: this is "one" bare string that contains quotes

@ -0,0 +1,3 @@
{t_name mix_string}
{t_object_separator :}
{t_string this is "one" bare string that contains quotes}

@ -0,0 +1 @@
1nbz32k: doauhef

@ -0,0 +1,3 @@
{t_name 1nbz32k}
{t_object_separator :}
{t_string doauhef}
Loading…
Cancel
Save