added ability for user to enter boolean literals
This commit is contained in:
parent
4865c7ce92
commit
c90d445d7d
1 changed files with 7 additions and 0 deletions
|
|
@ -26,6 +26,10 @@ const string_delims string = "\"'`"
|
||||||
|
|
||||||
func Lex(input string) *Token {
|
func Lex(input string) *Token {
|
||||||
ret := lex(input)
|
ret := lex(input)
|
||||||
|
if ret == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
if ret.Tag != LIST {
|
if ret.Tag != LIST {
|
||||||
temp := &Token{Tag: LIST}
|
temp := &Token{Tag: LIST}
|
||||||
temp.Direct(ret)
|
temp.Direct(ret)
|
||||||
|
|
@ -67,6 +71,9 @@ func lex(input string) *Token {
|
||||||
} else if StrIsNumber(tok) {
|
} else if StrIsNumber(tok) {
|
||||||
(*iter).Tag = NUMBER
|
(*iter).Tag = NUMBER
|
||||||
|
|
||||||
|
} else if tok == "T" || tok == "F" {
|
||||||
|
(*iter).Tag = BOOL
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
(*iter).Tag = SYMBOL
|
(*iter).Tag = SYMBOL
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue