You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by gr...@apache.org on 2019/08/22 20:51:34 UTC

[royale-compiler] branch develop updated (4963671 -> 4ec4363)

This is an automated email from the ASF dual-hosted git repository.

gregdove pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git.


    from 4963671  compiler-jx: moved inject_html detection for source files back into GoogDepsWriter for now
     new ff7fb7a  Fix for output of e4X namespace-based child and descendant queries
     new d5144c1  Minor: remove extra comma in bindings output.
     new 4ec4363  Add newline after binding-related output. Fixes output formatting and avoids a js parsing error when certain other output immediately after the last one of these.

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../internal/codegen/js/jx/AccessorEmitter.java    |  1 +
 .../codegen/js/jx/MemberAccessEmitter.java         | 56 ++++++++++++----------
 .../codegen/mxml/royale/MXMLRoyaleEmitter.java     | 25 ++++++----
 3 files changed, 50 insertions(+), 32 deletions(-)


[royale-compiler] 02/03: Minor: remove extra comma in bindings output.

Posted by gr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gregdove pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git

commit d5144c19d15eea6b1f765d1c353376dda69ab4de
Author: greg-dove <gr...@gmail.com>
AuthorDate: Fri Aug 23 06:59:03 2019 +1200

    Minor: remove extra comma in bindings output.
---
 .../codegen/mxml/royale/MXMLRoyaleEmitter.java     | 25 +++++++++++++++-------
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/royale/MXMLRoyaleEmitter.java b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/royale/MXMLRoyaleEmitter.java
index 3dc1a2c..e06efba 100644
--- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/royale/MXMLRoyaleEmitter.java
+++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/royale/MXMLRoyaleEmitter.java
@@ -1335,8 +1335,8 @@ public class MXMLRoyaleEmitter extends MXMLEmitter implements
     private void outputBindingInfoAsData(String cname, BindingDatabase bindingDataBase)
     {
         IASEmitter asEmitter = ((IMXMLBlockWalker) getMXMLWalker())
-        .getASEmitter();
-
+                .getASEmitter();
+        
         writeNewline("/**");
         writeNewline(" * @export"); // must export or else GCC will remove it
         writeNewline(" */");
@@ -1345,9 +1345,11 @@ public class MXMLRoyaleEmitter extends MXMLEmitter implements
 
         Set<BindingInfo> bindingInfo = bindingDataBase.getBindingInfo();
         writeNewline(bindingInfo.size() + ","); // number of bindings
-
+        boolean hadOutput = false;
         for (BindingInfo bi : bindingInfo)
         {
+            if (hadOutput) writeNewline(ASEmitterTokens.COMMA.getToken());
+            hadOutput = true;
             String s;
             IMXMLNode node = bi.node;
             if (node instanceof IMXMLSingleDataBindingNode)
@@ -1438,7 +1440,7 @@ public class MXMLRoyaleEmitter extends MXMLEmitter implements
 
             if (s == null)
             {
-                writeNewline(ASEmitterTokens.NULL.getToken() + ASEmitterTokens.COMMA.getToken());
+                write(ASEmitterTokens.NULL.getToken());
             }
             else if (s.contains("."))
             {
@@ -1451,17 +1453,22 @@ public class MXMLRoyaleEmitter extends MXMLEmitter implements
                     String part = parts[i];
                     write(", " + ASEmitterTokens.DOUBLE_QUOTE.getToken() + part + ASEmitterTokens.DOUBLE_QUOTE.getToken());
                 }
-                writeNewline(ASEmitterTokens.SQUARE_CLOSE.getToken() + ASEmitterTokens.COMMA.getToken());
+                write(ASEmitterTokens.SQUARE_CLOSE.getToken());
             }
             else
-                writeNewline(ASEmitterTokens.DOUBLE_QUOTE.getToken() + s +
-                        ASEmitterTokens.DOUBLE_QUOTE.getToken() + ASEmitterTokens.COMMA.getToken());
+                write(ASEmitterTokens.DOUBLE_QUOTE.getToken() + s +
+                        ASEmitterTokens.DOUBLE_QUOTE.getToken());
+            
         }
         Set<Entry<Object, WatcherInfoBase>> watcherChains = bindingDataBase.getWatcherChains();
-
+        
         if (watcherChains != null)
         {
             int count = watcherChains.size();
+            if (hadOutput) {
+                if (count > 0) writeNewline(ASEmitterTokens.COMMA);
+                else writeNewline();
+            }
             for (Entry<Object, WatcherInfoBase> entry : watcherChains)
             {
                 count--;
@@ -1469,6 +1476,8 @@ public class MXMLRoyaleEmitter extends MXMLEmitter implements
                 encodeWatcher(watcherInfoBase);
                 if (count > 0) writeNewline(ASEmitterTokens.COMMA);
             }
+        } else {
+            if (hadOutput) writeNewline();
         }
 
         writeNewline( ASEmitterTokens.SQUARE_CLOSE.getToken() + ASEmitterTokens.SEMICOLON.getToken());


[royale-compiler] 01/03: Fix for output of e4X namespace-based child and descendant queries

Posted by gr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gregdove pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git

commit ff7fb7afd61ad84984734e6c4825a5a2c48b80be
Author: greg-dove <gr...@gmail.com>
AuthorDate: Fri Aug 23 06:49:54 2019 +1200

    Fix for output of e4X namespace-based child and descendant queries
---
 .../codegen/js/jx/MemberAccessEmitter.java         | 56 ++++++++++++----------
 1 file changed, 32 insertions(+), 24 deletions(-)

diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/MemberAccessEmitter.java b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/MemberAccessEmitter.java
index cc0a892..28a60cf 100644
--- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/MemberAccessEmitter.java
+++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/MemberAccessEmitter.java
@@ -95,30 +95,38 @@ public class MemberAccessEmitter extends JSSubEmitter implements
         							rightNode.getNodeID() != ASTNodeID.Op_AtID &&
         							!((rightNode.getNodeID() == ASTNodeID.ArrayIndexExpressionID) && 
         									(((DynamicAccessNode)rightNode).getLeftOperandNode().getNodeID() == ASTNodeID.Op_AtID));
-        		if (descendant || child)
-	        	{
-	        		writeLeftSide(node, leftNode, rightNode);
-	        		if (descendant)
-	        			write(".descendants('");
-	        		if (child)
-	        			write(".child('");	        			
-	        		String s = fjs.stringifyNode(rightNode);
-	        		int dot = s.indexOf('.');
-	        		if (dot != -1)
-	        		{
-	        			String name = s.substring(0, dot);
-	        			String afterDot = s.substring(dot);
-	        			write(name);
-	        			write("')");
-	        			write(afterDot);
-	        		}
-	        		else
-	        		{
-	        			write(s);
-	        			write("')");
-	        		}
-	        		return;
-	        	}
+        		if (descendant || child) {
+					writeLeftSide(node, leftNode, rightNode);
+					if (descendant)
+						write(".descendants(");
+					if (child)
+						write(".child(");
+					String closeMethodCall = "')";
+					String s = "";
+					if (rightNode instanceof INamespaceAccessExpressionNode) {
+						//use a QName to support the namespace access
+						write("new QName(");
+						NamespaceIdentifierNode namespaceIdentifierNode = (NamespaceIdentifierNode) ((INamespaceAccessExpressionNode) rightNode).getLeftOperandNode();
+						s = fjs.stringifyNode(namespaceIdentifierNode);
+						write(s + ", '");
+						rightNode = ((INamespaceAccessExpressionNode) rightNode).getRightOperandNode();
+						closeMethodCall = "'))";
+					} else write("'"); //normal string name for child
+			
+					s = fjs.stringifyNode(rightNode);
+					int dot = s.indexOf('.');
+					if (dot != -1) {
+						String name = s.substring(0, dot);
+						String afterDot = s.substring(dot);
+						write(name);
+						write(closeMethodCall);
+						write(afterDot);
+					} else {
+						write(s);
+						write(closeMethodCall);
+					}
+					return;
+				}
         	}
         	else if (isProxy)
         	{


[royale-compiler] 03/03: Add newline after binding-related output. Fixes output formatting and avoids a js parsing error when certain other output immediately after the last one of these.

Posted by gr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gregdove pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git

commit 4ec4363187e4e748f8fd6387f188d17befbf298e
Author: greg-dove <gr...@gmail.com>
AuthorDate: Fri Aug 23 07:02:41 2019 +1200

    Add newline after binding-related output. Fixes output formatting and avoids a js parsing error when certain other output immediately after the last one of these.
---
 .../apache/royale/compiler/internal/codegen/js/jx/AccessorEmitter.java   | 1 +
 1 file changed, 1 insertion(+)

diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/AccessorEmitter.java b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/AccessorEmitter.java
index e0f955f..dcaeacf 100644
--- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/AccessorEmitter.java
+++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/AccessorEmitter.java
@@ -763,6 +763,7 @@ public class AccessorEmitter extends JSSubEmitter implements
             fjs.emitParameters(node.getParametersContainerNode());
             //writeNewline();
             fjs.emitMethodScope(node.getScopedNode());
+			writeNewline();
         }
     }
 }