Skip to content
This repository was archived by the owner on Apr 8, 2018. It is now read-only.

Generate more tokens, especially within tags #2

Open
lxcid opened this issue Dec 24, 2015 · 1 comment
Open

Generate more tokens, especially within tags #2

lxcid opened this issue Dec 24, 2015 · 1 comment
Assignees

Comments

@lxcid
Copy link
Member

lxcid commented Dec 24, 2015

  • New Line
  • Whitespace
  • Dot
  • Parentheses
  • Comma
@lxcid lxcid self-assigned this Dec 24, 2015
@lxcid
Copy link
Member Author

lxcid commented Dec 26, 2015

Proposal:

Right now, scan and scanUntil of Scanner provide the bulk of lexer logic but it doesn't tokenize new line, white spaces, dot, parentheses and comma which can greatly empower our parser.

Mustache lexer can't be context free as its delimiter can be changed on run time. So the lexer need to be able to identify tags (denoted by wrapping in open and close delimiters) and look out for set delimiter tag. Triple mustache {{{ can also complicate the lexer logic.

The goal is to:

  • Store only range in lexer token.
  • able to parse delimiter and response to set delimiter.
  • handle open and close escaped tag modifier.
  • We should only visit each character only once.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant