Closed tbranyen closed 9 years ago
Unclear on the language of "two cases of ASSIGNMENT the as
in database" -- feel like there's an article missing. Is the issue that "as" is a substring of DatabASe?
Yup, the tokenizer can't differentiate and probably shouldn't. This logic seems to make most sense in the tree builder.
I'm not sure I agree (or possibly don't follow the rationale). as
(spaces) vs [^\s]as[^\s]
seem like very different types of token, to me -- but I also don't know much about how the tokenizer works, so I may be missing a deeper reason that this needs to be handled by a conditional instead of not being parsed as a non-identifier token in the first place
@kadamwhite here's the grammar that the tokenizer uses to parse 'as' as ASSIGN https://github.com/tbranyen/combyne/blob/master/lib/grammar.js#L41
Since it parses for all of them, even within other words, it's up to the tree builder to understand how to string them together. The tokenizer's job shouldn't be to try and understand context of where it's used.
While working on a sample benchmarking app, I noticed that the following was invalid:
Using the the object:
I was unable to get the template to render correctly.
After inspecting the
template.tree
object, I was able to discover that the tokenizer had correctly found two cases of ASSIGNMENT theas
in database.I updated the AST generation code to account for actual assignment and properly adjust depending on what's passed.