-
Notifications
You must be signed in to change notification settings - Fork 124
mustachio: Separate out the context stack LUB type calculation #3730
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 part of the codegen is kinda confusing. Why do we use the first compiler's
_syntaxTree
and_buildData
when making thelubCompiler
? Also, perhaps move this variable down there, since it's not being used forcontextStacksLength
anymoreAll the other changes seem okay to me.
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.
First, apologies for this not being well documented, I do plan on sending out docs next.
OK, so in this section, we are looking at the "partial compilers" that have been generated for each partial file path. So if one template referred to the "_foo.html" partial with
{{ >foo }}
and another template also referred to that partial file with{{ >foo }}
, then we have to partial compilers, and we're trying to deduplicate them. The reason they are initially separate and why we might not be able to deduplicate is that the variables in scope might be different from one calling template to another.OK, so the variables might be different, but what is always common between these compilers (for the same partial path) is that they parse out to the same syntax tree (since its the same file on disk). And the
_buildData
is also just a common grab bag of data.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.
I see! Okay, that makes a lot of sense. Yeah, some extra documentation on that would be great :)