-rw-r--r-- | expr-lexer.lua | 4 |
diff --git a/expr-lexer.lua b/expr-lexer.lua index c075d8a5..c13b1c38 100644 --- a/expr-lexer.lua +++ b/expr-lexer.lua @@ -52,6 +52,10 @@ function expr_lexer.next_token(lexer) lexer:skip('%s*') if lexer.n > len(lexer.src) then return {type= 'EOF'} end local c = lexer:char() + if c == '\'' then + local str = lexer:consume("'[^']+'") + return {type= 'literal', value = str:sub(2, -2)} + end if c == '[' then local str = lexer:consume('%b[]') return {type= 'ident', value= str:sub(2,-2)} |