Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better compiler #2

Merged
merged 17 commits into from
Jul 3, 2014
Merged

Better compiler #2

merged 17 commits into from
Jul 3, 2014

Conversation

phpnode
Copy link
Member

@phpnode phpnode commented Jul 3, 2014

This PR makes quite a few disjointed changes:

  1. <layout> is now <include> and supports bind="{{something}}", repeat="{{thing in things}}". This makes it possible to use it for both "layouts" and "partials".
  2. Instead of the compiler basically being a huge AST in which we fill in the blanks, the compiler now uses a parse + replace approach. We write the compilation cases in normal JS, parse those to AST, perform transformations on it and include them in the real AST.
  3. There is now an optimiser which does several passes to remove unnecessary code, hoists functions etc.
  4. There is now explicit support for use as an express view engine.

samsonradu added a commit that referenced this pull request Jul 3, 2014
@samsonradu samsonradu merged commit 39b0199 into master Jul 3, 2014
@phpnode phpnode deleted the better-compiler branch July 3, 2014 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants