You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2014/11/10 19:05:52 UTC
[6/7] git commit: [flex-falcon] [refs/heads/develop] - suppress more
as-only asdoc annotations and rename param and return to avoid duplicates
suppress more as-only asdoc annotations and rename param and return to avoid duplicates
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/edb8bcb2
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/edb8bcb2
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/edb8bcb2
Branch: refs/heads/develop
Commit: edb8bcb2c989fbaed3dceffe4fc5503eae757e34
Parents: 2d9e423
Author: Alex Harui <ah...@apache.org>
Authored: Mon Nov 10 09:06:50 2014 -0800
Committer: Alex Harui <ah...@apache.org>
Committed: Mon Nov 10 09:06:50 2014 -0800
----------------------------------------------------------------------
.../codegen/js/flexjs/JSFlexJSDocEmitter.java | 24 ++++++++++++++------
.../utils/JSClosureCompilerWrapper.java | 4 +++-
2 files changed, 20 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/edb8bcb2/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSDocEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSDocEmitter.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSDocEmitter.java
index 6e3524b..044c2f7 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSDocEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSDocEmitter.java
@@ -63,7 +63,7 @@ public class JSFlexJSDocEmitter extends JSGoogDocEmitter
if (node.isConstructor())
{
if (asDoc != null && MXMLJSC.keepASDoc)
- write(asDoc.commentNoEnd());
+ write(changeAnnotations(asDoc.commentNoEnd()));
else
begin();
hasDoc = true;
@@ -98,7 +98,7 @@ public class JSFlexJSDocEmitter extends JSGoogDocEmitter
if (ns != null)
{
if (asDoc != null && MXMLJSC.keepASDoc)
- write(asDoc.commentNoEnd());
+ write(changeAnnotations(asDoc.commentNoEnd()));
else
begin();
emitMethodAccess(node);
@@ -113,7 +113,7 @@ public class JSFlexJSDocEmitter extends JSGoogDocEmitter
if (!hasDoc)
{
if (asDoc != null && MXMLJSC.keepASDoc)
- write(asDoc.commentNoEnd());
+ write(changeAnnotations(asDoc.commentNoEnd()));
else
begin();
emitMethodAccess(node);
@@ -140,7 +140,7 @@ public class JSFlexJSDocEmitter extends JSGoogDocEmitter
if (!hasDoc)
{
if (asDoc != null && MXMLJSC.keepASDoc)
- write(asDoc.commentNoEnd());
+ write(changeAnnotations(asDoc.commentNoEnd()));
else
begin();
emitMethodAccess(node);
@@ -166,7 +166,7 @@ public class JSFlexJSDocEmitter extends JSGoogDocEmitter
if (!hasDoc)
{
if (asDoc != null && MXMLJSC.keepASDoc)
- write(asDoc.commentNoEnd());
+ write(changeAnnotations(asDoc.commentNoEnd()));
else
begin();
emitMethodAccess(node);
@@ -182,6 +182,16 @@ public class JSFlexJSDocEmitter extends JSGoogDocEmitter
}
}
+ private String changeAnnotations(String doc)
+ {
+ // rename these tags so they don't conflict with generated
+ // jsdoc tags
+ String pass1 = doc.replaceAll("@param", "@asparam");
+ String pass2 = pass1.replaceAll("@return", "@asreturn");
+ String pass3 = pass2.replaceAll("@private", "@asprivate");
+ return pass3;
+ }
+
public void emitInterfaceMemberDoc(IDefinitionNode node, ICompilerProject project)
{
boolean hasDoc = false;
@@ -193,7 +203,7 @@ public class JSFlexJSDocEmitter extends JSGoogDocEmitter
&& returnType != ASEmitterTokens.VOID.getToken()) // has return
{
if (asDoc != null && MXMLJSC.keepASDoc)
- write(asDoc.commentNoEnd());
+ write(changeAnnotations(asDoc.commentNoEnd()));
else
begin();
hasDoc = true;
@@ -210,7 +220,7 @@ public class JSFlexJSDocEmitter extends JSGoogDocEmitter
if (!hasDoc)
{
if (asDoc != null && MXMLJSC.keepASDoc)
- write(asDoc.commentNoEnd());
+ write(changeAnnotations(asDoc.commentNoEnd()));
else
begin();
hasDoc = true;
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/edb8bcb2/compiler.jx/src/org/apache/flex/compiler/utils/JSClosureCompilerWrapper.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/utils/JSClosureCompilerWrapper.java b/compiler.jx/src/org/apache/flex/compiler/utils/JSClosureCompilerWrapper.java
index 5c5907e..6f3543d 100644
--- a/compiler.jx/src/org/apache/flex/compiler/utils/JSClosureCompilerWrapper.java
+++ b/compiler.jx/src/org/apache/flex/compiler/utils/JSClosureCompilerWrapper.java
@@ -134,7 +134,9 @@ public class JSClosureCompilerWrapper
WarningLevel.VERBOSE.setOptionsForWarningLevel(options_);
String[] asdocTags = new String[] {"productversion",
- "playerversion", "langversion", "copy"};
+ "playerversion", "langversion", "copy",
+ "asparam", "asreturn", "asprivate",
+ "flexjsignoreimport", "flexjsignorecoercion"};
options_.setExtraAnnotationNames(Arrays.asList(asdocTags));
}