flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cd...@apache.org
Subject [32/50] git commit: [flex-falcon] [refs/heads/feature/maven-migration] - ASEmitter: reverted change to emitIf() because JSEmitter was refactored to handle this in a sub-emitter
Date Mon, 11 Apr 2016 13:59:59 GMT
ASEmitter: reverted change to emitIf() because JSEmitter was refactored to handle this in a
sub-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/dd409d31
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/dd409d31
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/dd409d31

Branch: refs/heads/feature/maven-migration
Commit: dd409d310dd2aa136c29e479b0bd4f721c7b3b22
Parents: 6613895
Author: Josh Tynjala <joshtynjala@apache.org>
Authored: Tue Apr 5 17:01:09 2016 -0700
Committer: Josh Tynjala <joshtynjala@apache.org>
Committed: Tue Apr 5 17:01:09 2016 -0700

----------------------------------------------------------------------
 .../compiler/internal/codegen/as/ASEmitter.java | 68 +++++++++-----------
 1 file changed, 32 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/dd409d31/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 1c4036e..875d1d2 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
@@ -878,8 +878,19 @@ public class ASEmitter implements IASEmitter, IEmitter
     public void emitIf(IIfNode node)
     {
         IConditionalNode conditional = (IConditionalNode) node.getChild(0);
-        emitConditional(conditional, false);
 
+        IContainerNode xnode = (IContainerNode) conditional
+                .getStatementContentsNode();
+
+        writeToken(ASEmitterTokens.IF);
+        //write(SPACE);
+        write(ASEmitterTokens.PAREN_OPEN);
+        getWalker().walk(conditional.getChild(0)); // conditional expression
+        write(ASEmitterTokens.PAREN_CLOSE);
+        if (!isImplicit(xnode))
+            write(ASEmitterTokens.SPACE);
+
+        getWalker().walk(conditional.getChild(1)); // BlockNode
         IConditionalNode[] nodes = node.getElseIfNodes();
         if (nodes.length > 0)
         {
@@ -895,49 +906,34 @@ public class ASEmitter implements IASEmitter, IEmitter
                 else
                     write(ASEmitterTokens.SPACE);
 
-                emitConditional(enode, true);
+                writeToken(ASEmitterTokens.ELSE);
+                writeToken(ASEmitterTokens.IF);
+                write(ASEmitterTokens.PAREN_OPEN);
+                getWalker().walk(enode.getChild(0));
+                write(ASEmitterTokens.PAREN_CLOSE);
+                if (!isImplicit)
+                    write(ASEmitterTokens.SPACE);
+
+                getWalker().walk(enode.getChild(1)); // ConditionalNode
             }
         }
 
         ITerminalNode elseNode = node.getElseNode();
         if (elseNode != null)
         {
-            emitElse(elseNode);
-        }
-    }
-
-    public void emitConditional(IConditionalNode node, boolean isElseIf)
-    {
-        IContainerNode xnode = (IContainerNode) node.getStatementContentsNode();
+            IContainerNode cnode = (IContainerNode) elseNode.getChild(0);
+            // if an implicit if, add a newline with no space
+            final boolean isImplicit = isImplicit(cnode);
+            if (isImplicit)
+                writeNewline();
+            else
+                write(ASEmitterTokens.SPACE);
+            write(ASEmitterTokens.ELSE);
+            if (!isImplicit)
+                write(ASEmitterTokens.SPACE);
 
-        if (isElseIf)
-        {
-            writeToken(ASEmitterTokens.ELSE);
+            getWalker().walk(elseNode); // TerminalNode
         }
-        writeToken(ASEmitterTokens.IF);
-        write(ASEmitterTokens.PAREN_OPEN);
-        getWalker().walk(node.getChild(0)); // conditional expression
-        write(ASEmitterTokens.PAREN_CLOSE);
-        if (!isImplicit(xnode))
-            write(ASEmitterTokens.SPACE);
-
-        getWalker().walk(node.getChild(1)); // BlockNode
-    }
-    
-    public void emitElse(ITerminalNode node)
-    {
-        IContainerNode cnode = (IContainerNode) node.getChild(0);
-        // if an implicit if, add a newline with no space
-        final boolean isImplicit = isImplicit(cnode);
-        if (isImplicit)
-            writeNewline();
-        else
-            write(ASEmitterTokens.SPACE);
-        write(ASEmitterTokens.ELSE);
-        if (!isImplicit)
-            write(ASEmitterTokens.SPACE);
-
-        getWalker().walk(node); // TerminalNode
     }
 
     @Override


Mime
View raw message