-
Notifications
You must be signed in to change notification settings - Fork 3
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
break the compiler up and have it configurable #66
Conversation
blocks: {}, | ||
state: STATES.OUTER_SPACE | ||
compile(ast, name, options) { | ||
let passes = options && options.passes || defaultPasses; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any way we could merge with default passes instead of overriding them?
start.bodies = bodies; | ||
start.body = h; | ||
start.bodies.unshift(['TORNADO_BODY', {name: null, type: 'bodies', body: contents}]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we give the default body a name (maybe default
or main
) so that it can be more easily referenced in helpers.
See the latest push I got the walker going correctly now (https://github.com/jimmyhchan/tornado/blob/extensible/src/compiler/visitor.js) I put a visualizing pass (https://github.com/jimmyhchan/tornado/blob/extensible/src/compiler/passes/visualize.js) and that looks correct. I combined the default body into So as it is right now: the AST is solid, the vistor and compiler passes work as expected. We just need to get the generate code doing what we expect. @smfoote can I get your thoughts. |
completely rewrite the generator logic to use a stack and output instructions
updated pull request thanks |
I forgot to delete the unneeded code from |
const PRODUCTION = 'production'; | ||
'use strict'; | ||
import Context from './compiler/context'; | ||
// import preprocess from './compiler/passes/preprocess'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove this line, and the related file. It's not necessary anymore.
see the last 2 commits. i think that covers the comments. |
return template; | ||
})();`; | ||
}; | ||
export let createMethodFooters = function(name, context) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method can be removed now (it's a part of generateJS.js
now)
break the compiler up and have it configurable
** Tests pass! **
use multiple passes for the compiler (like https://github.com/pegjs/pegjs/tree/master/lib/compiler/passes).
The heart of this can be seen in:
check
vstransform
vsgenerate
) and either converts to AST or read/writes into the object.