flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cd...@apache.org
Subject [32/44] git commit: [flex-falcon] [refs/heads/feature-autobuild/maven-archetypes] - merge develop
Date Fri, 21 Oct 2016 15:17:10 GMT
merge develop


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

Branch: refs/heads/feature-autobuild/maven-archetypes
Commit: 80eb2361059d483a93a087b8c844b14563074a63
Parents: 72f0c52 a965094
Author: Josh Tynjala <joshtynjala@gmail.com>
Authored: Fri Oct 14 10:50:35 2016 -0700
Committer: Josh Tynjala <joshtynjala@gmail.com>
Committed: Fri Oct 14 10:57:09 2016 -0700

----------------------------------------------------------------------
 .../apache/flex/compiler/clients/ASDOCJSC.java  |  13 --
 .../apache/flex/compiler/clients/COMPJSC.java   |   2 -
 .../compiler/internal/codegen/js/JSEmitter.java |   7 +
 .../internal/codegen/js/JSSessionModel.java     |   1 -
 .../codegen/js/flexjs/JSFlexJSASDocEmitter.java |  63 ------
 .../internal/codegen/js/jx/AccessorEmitter.java |   2 -
 .../codegen/js/jx/BinaryOperatorEmitter.java    |   2 -
 .../internal/codegen/js/jx/FieldEmitter.java    |  14 --
 .../codegen/js/jx/FunctionCallEmitter.java      |  30 ++-
 .../codegen/js/jx/IdentifierEmitter.java        |   4 -
 .../internal/codegen/js/jx/LiteralEmitter.java  |   8 +-
 .../codegen/js/jx/MemberAccessEmitter.java      |   3 -
 .../codegen/js/jx/StatementEmitter.java         |   6 +
 .../codegen/js/jx/SuperCallEmitter.java         |   2 -
 .../mxml/flexjs/MXMLFlexJSASDocEmitter.java     | 210 -------------------
 .../codegen/mxml/flexjs/MXMLFlexJSEmitter.java  |   6 +-
 .../driver/js/goog/ASDocConfiguration.java      |   2 -
 .../driver/mxml/ASDocASSourceFileHandler.java   |   1 -
 .../mxml/flexjs/MXMLFlexJSASDocBackend.java     |   5 -
 .../internal/projects/FlexJSProject.java        |   1 -
 .../js/flexjs/TestFlexJSGlobalClasses.java      |  26 +++
 .../js/flexjs/TestFlexJSGlobalFunctions.java    |   8 +
 .../codegen/js/flexjs/TestFlexJSStatements.java |  13 ++
 .../flex/compiler/internal/scopes/ASScope.java  |   2 -
 .../compiler/internal/tree/as/ImportNode.java   |   1 -
 .../src/test/java/as/ASInheritanceTests.java    |   1 -
 26 files changed, 91 insertions(+), 342 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/80eb2361/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/LiteralEmitter.java
----------------------------------------------------------------------
diff --cc compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/LiteralEmitter.java
index c3e371d,d3fc55d..47f0c8d
--- a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/LiteralEmitter.java
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/LiteralEmitter.java
@@@ -59,83 -49,60 +59,83 @@@ public class LiteralEmitter extends JSS
          {
              if (node.getLiteralType() == LiteralType.XML)
              {
 -            	newlineReplacement = "\\\\\n";
 -            	XMLLiteralNode xmlNode = (XMLLiteralNode)node;
 -            	if (xmlNode.getContentsNode().getChildCount() == 1)
 -            	{
 -	            	if (s.contains("'"))
 -	            		s = "\"" + s + "\"";
 -	            	else
 -	            		s = "'" + s + "'";
 -            	}
 -            	else
 -            	{
 -        			StringBuilder sb = new StringBuilder();
 -            		// probably contains {initializers}
 -        			boolean inAttribute = false;
 -            		int n = xmlNode.getContentsNode().getChildCount();
 -            		for (int i = 0; i < n; i++)
 -            		{
 -            			if (i > 0)
 -            				sb.append(" + ");
 -            			IASNode child = xmlNode.getContentsNode().getChild(i);
 -            			if (child instanceof LiteralNode)
 -            			{
 -            				s = ((LiteralNode)child).getValue(true);
 -        	            	if (s.contains("'"))
 -        	            		sb.append("\"" + s + "\"");
 -        	            	else
 -        	            		sb.append("'" + s + "'");
 -            			}
 -            			else
 -            			{
 -            				s = getEmitter().stringifyNode(child);
 -            				if (inAttribute)
 -            				{
 -            					sb.append("'\"' + ");
 -
 -            					sb.append(s);
 -            					
 -            					sb.append(" + '\"'");
 -            				}
 -            				else
 -            					sb.append(s);
 -            			}
 -        				inAttribute = s.endsWith("=");
 -            		}
 -            		s = sb.toString();
 -            	}
 -                char c = s.charAt(0);
 -                if (c == '"')
 +                boolean jsx = false;
 +                IFunctionNode functionNode = (IFunctionNode) node
 +                        .getAncestorOfType(IFunctionNode.class);
 +                if (functionNode != null)
                  {
 -                    s = s.substring(1, s.length() - 1);
 -                    s = s.replace("\"", "\\\"");
 -                    s = "\"" + s + "\"";
 +                    IMetaInfo[] metaInfos = functionNode.getMetaInfos();
 +                    for (IMetaInfo metaInfo : metaInfos)
 +                    {
 +                        if (metaInfo.getTagName().equals(JSFlexJSEmitterTokens.JSX.getToken()))
 +                        {
 +                            jsx = true;
 +                            break;
 +                        }
 +                    }
 +                }
 +                XMLLiteralNode xmlNode = (XMLLiteralNode) node;
 +                if (jsx)
 +                {
 +                    emitJSX(xmlNode);
 +                    return;
 +                }
 +                else
 +                {
 +                    newlineReplacement = "\\\\\n";
 +                    if (xmlNode.getContentsNode().getChildCount() == 1)
 +                    {
 +                        if (s.contains("'"))
 +                            s = "\"" + s + "\"";
 +                        else
 +                            s = "'" + s + "'";
 +                    }
 +                    else
 +                    {
 +                        StringBuilder sb = new StringBuilder();
 +                        // probably contains {initializers}
 +                        boolean inAttribute = false;
 +                        int n = xmlNode.getContentsNode().getChildCount();
 +                        for (int i = 0; i < n; i++)
 +                        {
 +                            if (i > 0)
 +                                sb.append(" + ");
 +                            IASNode child = xmlNode.getContentsNode().getChild(i);
 +                            if (child instanceof LiteralNode)
 +                            {
-                                 s = ((LiteralNode) child).getValue(true);
++                                s = ((LiteralNode)child).getValue(true);
 +                                if (s.contains("'"))
 +                                    sb.append("\"" + s + "\"");
 +                                else
 +                                    sb.append("'" + s + "'");
 +                            }
 +                            else
 +                            {
 +                                s = getEmitter().stringifyNode(child);
 +                                if (inAttribute)
 +                                {
 +                                    sb.append("'\"' + ");
- 
++    
 +                                    sb.append(s);
- 
++                                    
 +                                    sb.append(" + '\"'");
 +                                }
 +                                else
 +                                    sb.append(s);
 +                            }
-                             inAttribute = s.equals("=");
++                            inAttribute = s.endsWith("=");
 +                        }
 +                        s = sb.toString();
 +                    }
 +                    char c = s.charAt(0);
 +                    if (c == '"')
 +                    {
 +                        s = s.substring(1, s.length() - 1);
 +                        s = s.replace("\"", "\\\"");
 +                        s = "\"" + s + "\"";
 +                    }
 +                    s = "new XML( " + s + ")";
                  }
 -                s = "new XML( " + s + ")";
              }
              s = s.replaceAll("\n", "__NEWLINE_PLACEHOLDER__");
              s = s.replaceAll("\r", "__CR_PLACEHOLDER__");


Mime
View raw message