You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by jo...@apache.org on 2016/04/18 08:27:33 UTC

[8/9] git commit: [flex-falcon] [refs/heads/develop] - compiler.jx: updated JSEmitter to support new getEndLine() and getEndColumn(), and tweaked some sub-emitters to use this change

compiler.jx: updated JSEmitter to support new getEndLine() and getEndColumn(), and tweaked some sub-emitters to use this change


Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/01629b23
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/01629b23
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/01629b23

Branch: refs/heads/develop
Commit: 01629b238544b16f934a91e863f0300956ba6d94
Parents: af3e883
Author: Josh Tynjala <jo...@apache.org>
Authored: Sun Apr 17 22:46:54 2016 -0700
Committer: Josh Tynjala <jo...@apache.org>
Committed: Sun Apr 17 22:46:54 2016 -0700

----------------------------------------------------------------------
 .../org/apache/flex/compiler/codegen/js/IJSEmitter.java   |  2 +-
 .../flex/compiler/internal/codegen/js/JSEmitter.java      | 10 +++++-----
 .../flex/compiler/internal/codegen/js/JSSubEmitter.java   |  4 ++--
 .../internal/codegen/js/jx/BlockCloseEmitter.java         |  2 +-
 .../internal/codegen/js/jx/LiteralContainerEmitter.java   |  2 +-
 .../codegen/js/jx/ObjectLiteralValuePairEmitter.java      |  6 +++---
 6 files changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/01629b23/compiler.jx/src/org/apache/flex/compiler/codegen/js/IJSEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/codegen/js/IJSEmitter.java b/compiler.jx/src/org/apache/flex/compiler/codegen/js/IJSEmitter.java
index 218b5be..287b8c8 100644
--- a/compiler.jx/src/org/apache/flex/compiler/codegen/js/IJSEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/codegen/js/IJSEmitter.java
@@ -59,7 +59,7 @@ public interface IJSEmitter extends IASEmitter
      * Adds a node to the source map after a particular node instead using the
      * node's own line and column.
      */
-    void startMapping(ISourceLocation node, ISourceLocation nodeBeforeMapping);
+    void startMapping(ISourceLocation node, ISourceLocation afterNode);
 
     /**
      * Commits a mapping to the source map.

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/01629b23/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/JSEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/JSEmitter.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/JSEmitter.java
index 1a73cf6..d0a4aa8 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/JSEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/JSEmitter.java
@@ -366,11 +366,6 @@ public class JSEmitter extends ASEmitter implements IJSEmitter
     {
         startMapping(node, node.getLine(), node.getColumn());
     }
-
-    public void startMapping(ISourceLocation node, ISourceLocation nodeBeforeMapping)
-    {
-        startMapping(node, nodeBeforeMapping.getLine(), nodeBeforeMapping.getColumn() + nodeBeforeMapping.getAbsoluteEnd() - nodeBeforeMapping.getAbsoluteStart());
-    }
     
     public void startMapping(ISourceLocation node, int line, int column)
     {
@@ -414,6 +409,11 @@ public class JSEmitter extends ASEmitter implements IJSEmitter
         lastMapping = mapping;
     }
 
+    public void startMapping(ISourceLocation node, ISourceLocation afterNode)
+    {
+        startMapping(node, afterNode.getEndLine(), afterNode.getEndColumn());
+    }
+
     public void endMapping(ISourceLocation node)
     {
         if (lastMapping == null)

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/01629b23/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/JSSubEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/JSSubEmitter.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/JSSubEmitter.java
index be0b9d1..f947af6 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/JSSubEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/JSSubEmitter.java
@@ -114,9 +114,9 @@ public class JSSubEmitter
         emitter.startMapping(node, line, column);
     }
 
-    protected void startMapping(ISourceLocation node, ISourceLocation nodeBeforeMapping)
+    protected void startMapping(ISourceLocation node, ISourceLocation afterNode)
     {
-        emitter.startMapping(node, nodeBeforeMapping);
+        emitter.startMapping(node, afterNode);
     }
 
     protected void endMapping(ISourceLocation node)

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/01629b23/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/BlockCloseEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/BlockCloseEmitter.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/BlockCloseEmitter.java
index 3099eda..058d132 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/BlockCloseEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/BlockCloseEmitter.java
@@ -36,7 +36,7 @@ public class BlockCloseEmitter extends JSSubEmitter implements
     @Override
     public void emit(IContainerNode node)
     {
-        startMapping(node);
+        startMapping(node, node);
         write(ASEmitterTokens.BLOCK_CLOSE);
         endMapping(node);
     }

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/01629b23/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/LiteralContainerEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/LiteralContainerEmitter.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/LiteralContainerEmitter.java
index d1d24fd..5e0fdce 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/LiteralContainerEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/LiteralContainerEmitter.java
@@ -88,7 +88,7 @@ public class LiteralContainerEmitter extends JSSubEmitter implements
 
         if (postFix != null)
         {
-            startMapping(node, node.getLine(), node.getColumn() + node.getAbsoluteEnd() - node.getAbsoluteStart() - 1);
+            startMapping(node, node.getEndLine(), node.getEndColumn() - postFix.length());
             write(postFix);
             endMapping(node);
         }

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/01629b23/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/ObjectLiteralValuePairEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/ObjectLiteralValuePairEmitter.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/ObjectLiteralValuePairEmitter.java
index d93d701..ad12b77 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/ObjectLiteralValuePairEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/ObjectLiteralValuePairEmitter.java
@@ -38,14 +38,14 @@ public class ObjectLiteralValuePairEmitter extends JSSubEmitter implements
     @Override
     public void emit(IObjectLiteralValuePairNode node)
     {
-        ISourceLocation sourceLocationNode = (ISourceLocation) node;
+        ISourceLocation location = (ISourceLocation) node;
 
         IExpressionNode nameNode = node.getNameNode();
         getWalker().walk(nameNode);
 
-        startMapping(sourceLocationNode, nameNode);
+        startMapping(location, nameNode);
         write(ASEmitterTokens.COLON);
-        endMapping(sourceLocationNode);
+        endMapping(location);
 
         IExpressionNode valueNode = node.getValueNode();
         getWalker().walk(valueNode);