Basic expression parsing

This commit is contained in:
Tristan Hume
2013-07-24 16:36:14 -04:00
parent 84be895db2
commit f43e973e67
2 changed files with 41 additions and 7 deletions
+4 -2
View File
@@ -21,7 +21,9 @@ module Liquid
'|' => :pipe,
'.' => :dot,
':' => :colon,
',' => :comma
',' => :comma,
'[' => :open_square,
']' => :close_square
}
IDENTIFIER = /[\w\-]+/
SINGLE_STRING_LITERAL = /'[^\']*'/
@@ -56,7 +58,7 @@ module Liquid
else
c = @ss.getch
if s = SPECIALS[c]
return Token[s]
return Token[s,c]
end
raise SyntaxError, "Unexpected character #{c}."