Closed maxkorp closed 10 years ago
I added a test inside of test/tests/lib/tokenParsing.js
that this pull request needs to pass before it can be merged.
Tweaked it to look for literals first, which are presumed to be able to contain anything else. Nothing will break a literal value, not spaces or hard delimiters or anything else. Works for both double and single quoted strings
Some more test cases were added that need to be passed. The example case is a property that's inside of a string.
"{{ hello }} world"
will always ignore the hello
property
This needs a bigger refactor of the grammar and the tokenizer to deal with some of the "quirkier" scenarios (and some expected behaviors need to be defined). Creating an issue for this instead.
A few key changes here
MakeEntry
now generates 2 tokens for "soft" delimiters, one checking for it being broken by a hard delimiter, and one checking for it hitting the end of the templatecaptures[1]
instead ofcaptures[0]
. Since the tokens can now mach something likeeach%}
, it became necessary to landeach
in a group, and I was able to unify them all oncapture[1]
, rather than flipflopping between 0 and 1 conditionally.\s
(which is\\s
in js sometimes because js is retarded, as much as i love it). Reads cleaner, and way, way easier to debug.