smfoote / tornado

HTML templates with asynchronous rendering, built with JavaScript.
http://smfoote.github.io/tornado/
Apache License 2.0
8 stars 3 forks source link

The parser should generically look at Tornado "code blocks" #73

Open jimmyhchan opened 9 years ago

jimmyhchan commented 9 years ago

Today the peg grammar handles distinguishing between a exists section etc.

e.g.

  var tornadoBodyTypes = {
    '?': 'exists',
    '^': 'notExists',
    '#': 'section',
    '@': 'helper',
    '+': 'block',
    '<': 'inlinePartial',
    '%': 'pragma'
  };

Now that we have an AST transform pass, we should be able to push this logic out into a separate pass and keep the grammar generic.

proposal:

issues: