Make the ID node capable of handling paths

TODO: handle invalid paths in the tokenizer or parser
  TODO: invalidate "{{ foo/ bar }}"
This commit is contained in:
wycats
2010-11-25 16:12:50 -08:00
parent 7d0204bf9f
commit f8b245896d
5 changed files with 31 additions and 10 deletions
+6
View File
@@ -36,6 +36,12 @@ describe "Tokenizer" do
result[1].should be_token("ID", "foo")
end
it "tokenizes a path as 'OPEN ID CLOSE'" do
result = tokenize("{{../foo/bar}}")
result.should match_tokens(%w(OPEN ID SEP ID SEP ID CLOSE))
result[1].should be_token("ID", "..")
end
it "tokenizes a simple mustahe with spaces as 'OPEN ID CLOSE'" do
result = tokenize("{{ foo }}")
result.should match_tokens(%w(OPEN ID CLOSE))