-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Idea: Preprocessor #1272
Comments
I just said the include should behave like a plain old replace by the file content. The blocks and mixin scopes issues will also be resolved, at least for includes (there is still the case of extension), no need to do a first pass to find all blocks & mixin definitions. It could even be an issue with nested block definitions & other yields points. |
@triccardi-systran I took your idea a step further, I've gotta admit that. But I wanted to credit you. 😃 The first pass scan for block & mixin defintions could free us from having to keep a certain order and could help with nested blocks. append my-block
p 2
block my-block
p 1 |
append before block already works, see layout.append.before-block.jade from my PR #1264. |
Probably because it is defined by the layout ( In flat files without layouts, scanning a file or adding some kind of precedence for tokens would be neccessary. We can't test it yet as blocks in flat files are pretty buggy, as we already know. :D |
This goes counter to what a lot of people might expect. |
As proposed here by @triccardi-systran, a preprocessor which runs through the code could solve many of our problems and could even lead to a performance increase (only lexing and parsing once).
For example, I would expect block and mixin definitions to be globally accessible, no matter when and where they were made.
A bit like JavaScript's
function name() {}
statement, but better.The preprocessor should:
The text was updated successfully, but these errors were encountered: