You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by cd...@apache.org on 2016/04/18 15:31:52 UTC
[03/14] git commit: [flex-falcon]
[refs/heads/feature/maven-migration-test] - compiler.jx: curly braces to open
and close blocks have been moved to the emitter
compiler.jx: curly braces to open and close blocks have been moved to the emitter
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/8c393616
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/8c393616
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/8c393616
Branch: refs/heads/feature/maven-migration-test
Commit: 8c393616b508426fa621e20c8d2b10d7a473b721
Parents: a9a399b
Author: Josh Tynjala <jo...@apache.org>
Authored: Sun Apr 17 15:17:13 2016 -0700
Committer: Josh Tynjala <jo...@apache.org>
Committed: Sun Apr 17 15:17:13 2016 -0700
----------------------------------------------------------------------
.../org/apache/flex/compiler/codegen/as/IASEmitter.java | 6 +++++-
.../internal/codegen/as/ASAfterNodeStrategy.java | 4 ++--
.../internal/codegen/as/ASBeforeNodeStrategy.java | 4 ++--
.../flex/compiler/internal/codegen/as/ASEmitter.java | 12 ++++++++++++
4 files changed, 21 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/8c393616/compiler.jx/src/org/apache/flex/compiler/codegen/as/IASEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/codegen/as/IASEmitter.java b/compiler.jx/src/org/apache/flex/compiler/codegen/as/IASEmitter.java
index bd0d1eb..2fe9eea 100644
--- a/compiler.jx/src/org/apache/flex/compiler/codegen/as/IASEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/codegen/as/IASEmitter.java
@@ -86,7 +86,7 @@ public interface IASEmitter extends IEmitter
void setDocEmitter(IDocEmitter value);
String postProcess(String output);
-
+
void emitImport(IImportNode node);
void emitPackageHeader(IPackageDefinition definition);
@@ -366,4 +366,8 @@ public interface IASEmitter extends IEmitter
void emitUseNamespace(IUseNamespaceNode node);
+ void emitBlockOpen(IContainerNode node);
+
+ void emitBlockClose(IContainerNode node);
+
}
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/8c393616/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASAfterNodeStrategy.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASAfterNodeStrategy.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASAfterNodeStrategy.java
index 1ac85f7..b274b57 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASAfterNodeStrategy.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASAfterNodeStrategy.java
@@ -59,10 +59,10 @@ public class ASAfterNodeStrategy implements IASNodeStrategy
if (node.getChildCount() != 0)
{
emitter.indentPop();
- ((IEmitter) emitter).writeNewline();
+ emitter.writeNewline();
}
- ((IEmitter) emitter).write(ASEmitterTokens.BLOCK_CLOSE);
+ emitter.emitBlockClose(container);
}
else if (type == ContainerType.IMPLICIT
|| type == ContainerType.SYNTHESIZED)
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/8c393616/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASBeforeNodeStrategy.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASBeforeNodeStrategy.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASBeforeNodeStrategy.java
index d481573..d960057 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASBeforeNodeStrategy.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASBeforeNodeStrategy.java
@@ -61,12 +61,12 @@ public class ASBeforeNodeStrategy implements IASNodeStrategy
if (type != ContainerType.IMPLICIT
&& type != ContainerType.SYNTHESIZED)
{
- ((IEmitter) emitter).write(ASEmitterTokens.BLOCK_OPEN);
+ emitter.emitBlockOpen(container);
}
if (parent.getNodeID() != ASTNodeID.LabledStatementID)
{
- ((IEmitter) emitter).writeNewline();
+ emitter.writeNewline();
}
}
}
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/8c393616/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASEmitter.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASEmitter.java
index 875d1d2..6f48f8e 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASEmitter.java
@@ -1524,6 +1524,18 @@ public class ASEmitter implements IASEmitter, IEmitter
}
@Override
+ public void emitBlockOpen(IContainerNode node)
+ {
+ write(ASEmitterTokens.BLOCK_OPEN);
+ }
+
+ @Override
+ public void emitBlockClose(IContainerNode node)
+ {
+ write(ASEmitterTokens.BLOCK_CLOSE);
+ }
+
+ @Override
public String stringifyNode(IASNode node)
{
boolean oldBufferWrite = isBufferWrite();