Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Jastadd2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
JastAdd
Jastadd2
Commits
88c78c8c
Commit
88c78c8c
authored
7 years ago
by
Emma Söderberg
Browse files
Options
Downloads
Patches
Plain Diff
Removes legacy rewrite code from code generated for incremental/region.
parent
9a8f3bb4
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/template/incremental/Notification.tt
+2
-129
2 additions, 129 deletions
src/template/incremental/Notification.tt
src/template/incremental/Tracking.tt
+2
-2
2 additions, 2 deletions
src/template/incremental/Tracking.tt
with
4 additions
and
131 deletions
src/template/incremental/Notification.tt
+
2
−
129
View file @
88c78c8c
...
@@ -373,18 +373,6 @@ $if(IncrementalLevelNode)
...
@@ -373,18 +373,6 @@ $if(IncrementalLevelNode)
}
}
$endif
$endif
$if(IncrementalLevelRegion)
/** @apilevel internal */
public boolean $ASTNode.inc_flush_child($ASTNode node) {
for (int i = 0; node.mayHaveRewrite() && i < children.length; i++) {
if (children[i] == node) {
return inc_restoreInitialForIndex(i, node.handler());
}
}
return true;
}
$endif
$endif
$endif
$endif
$endif
$endif
$endif
...
@@ -525,80 +513,14 @@ $if(IncrementalLevelRegion)
...
@@ -525,80 +513,14 @@ $if(IncrementalLevelRegion)
$if(#isRegionRoot)
$if(#isRegionRoot)
/** @apilevel internal */
/** @apilevel internal */
public boolean #name.inc_flushRegionRoot() {
public boolean #name.inc_flushRegionRoot() {
// Check for rewrites
// check for inner rewrite in region root
boolean rewriteFlushed = true;
if (parent != null) {
rewriteFlushed = parent.inc_flush_child(this);
// region root had an outer rewrite which was flushed (parent == null) -> done
if (rewriteFlushed && parent == null) {
return true;
}
}
boolean innerRewrite = false;
if (rewriteFlushed) {
// the region may have inner rewrites
innerRewrite = inc_checkRegionForInnerRewrite();
} else {
// region root had an inner rewrite which wasn't flushed
innerRewrite = true;
}
// Inner rewrites in the region (including the root) means abort and notify the enclosing rewritten node
if (innerRewrite) {
$ASTNode enclosingNode = inc_locateEnclosingRewrittenNode();
enclosingNode.handler().flushRegion();
return false;
}
// Check NTAs, this may remove the region
boolean regionRemoved = false;
if (parent != null) {
regionRemoved = parent.inc_flush_NTA(this); // check NTA
}
// region is still here, flush remaining values and outer rewrites
if (!regionRemoved) {
inc_flushRegion_rewrites();
inc_flushRegion();
inc_flushRegion();
}
return true;
return true;
}
}
$else
$else
$if(#isASTNodeDecl)
$if(#isASTNodeDecl)
/** @apilevel internal */
/** @apilevel internal */
public boolean #name.inc_flushRegionRoot() {
public boolean #name.inc_flushRegionRoot() {
// Check for rewrites
// check for inner rewrite in region root
boolean rewriteFlushed = true;
if (parent != null) {
rewriteFlushed = parent.inc_flush_child(this);
// region root had an outer rewrite which was flushed (parent == null) -> done
if (rewriteFlushed && parent == null) {
return true;
}
}
boolean innerRewrite = false;
if (rewriteFlushed) {
// the region may have inner rewrites
innerRewrite = inc_checkRegionForInnerRewrite();
} else {
// region root had an inner rewrite which wasn't flushed
innerRewrite = true;
}
// Inner rewrites in the region (including the root) means abort and notify the enclosing rewritten node
if (innerRewrite) {
$ASTNode enclosingNode = inc_locateEnclosingRewrittenNode();
enclosingNode.handler().flushRegion();
return false;
}
// Check NTAs, this may remove the region
boolean regionRemoved = false;
if (parent != null) {
regionRemoved = parent.inc_flush_NTA(this); // check NTA
}
// region is still here, flush remaining values and outer rewrites
if (!regionRemoved) {
inc_flushRegion_rewrites();
inc_flushRegion();
inc_flushRegion();
}
return true;
return true;
}
}
$endif
$endif
...
@@ -639,29 +561,6 @@ ASTNode.incCheckRegionForInnerRewriteMethod = [[
...
@@ -639,29 +561,6 @@ ASTNode.incCheckRegionForInnerRewriteMethod = [[
$if(IncrementalEnabled)
$if(IncrementalEnabled)
$if(IncrementalChangeFlush)
$if(IncrementalChangeFlush)
$if(IncrementalLevelRegion)
$if(#isASTNodeDecl)
/** @apilevel internal */
public boolean $ASTNode.inc_checkRegionForInnerRewrite() {
for (int i = 0; children != null && children_computed != null && i < children.length && i < children_computed.length; i++) {
$ASTNode child = children[i];
if (child != null && !child.isRegionRoot()) {
if (children_computed[i]) {
if (init_children != null && i < init_children.length && init_children[i] == null) {
return true;
}
} else {
if (child.inc_checkRegionForInnerRewrite()) {
return true;
}
}
}
}
return false;
}
$endif
$endif
$if(IncrementalLevelNode)
$if(IncrementalLevelNode)
$if(#isASTNodeDecl)
$if(#isASTNodeDecl)
/** @apilevel internal */
/** @apilevel internal */
...
@@ -782,32 +681,6 @@ ASTNode.incFlushRegionRewritesMethod = [[
...
@@ -782,32 +681,6 @@ ASTNode.incFlushRegionRewritesMethod = [[
$if(IncrementalEnabled)
$if(IncrementalEnabled)
$if(IncrementalChangeFlush)
$if(IncrementalChangeFlush)
$if(IncrementalLevelRegion)
$if(#isASTNodeDecl)
/** @apilevel internal */
public boolean $ASTNode.inc_flushRegion_rewrites() {
for (int i = 0; children != null && i < children.length; i++) {
$ASTNode child = children[i];
if (child == null || child.isRegionRoot()) {
continue;
}
// rewritten child
if (children_computed != null && i < children_computed.length && children_computed[i]) {
if (!inc_restoreInitialForIndex(i, handler())) {
return false;
}
} else {
// not rewritten child
if (!child.inc_flushRegion_rewrites()) {
return false;
}
}
}
return true;
}
$endif
$endif
$if(IncrementalLevelAttr)
$if(IncrementalLevelAttr)
$if(#isASTNodeDecl)
$if(#isASTNodeDecl)
/** @apilevel internal */
/** @apilevel internal */
...
...
This diff is collapsed.
Click to expand it.
src/template/incremental/Tracking.tt
+
2
−
2
View file @
88c78c8c
...
@@ -382,11 +382,11 @@ ASTNode.incHookGetChildExitEval = [[
...
@@ -382,11 +382,11 @@ ASTNode.incHookGetChildExitEval = [[
$if(IncrementalEnabled)
$if(IncrementalEnabled)
$if(IncrementalLevelParam)
$if(IncrementalLevelParam)
//
state().exitAttrStoreEval(getChild_handler[i]);
state().exitAttrStoreEval(getChild_handler[i]);
$endif
$endif
$if(IncrementalLevelRegion)
$if(IncrementalLevelRegion)
//
state().exitAttrStoreEval(handler());
state().exitAttrStoreEval(handler());
$endif
$endif
$endif
$endif
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment