This is an automated email from the ASF dual-hosted git repository.
Harbs pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git
The following commit(s) were added to refs/heads/develop by this push:
new 471d89534 feat(asdoc): Update ASDocComment to handle Windows line
endings and add test for private ASDoc tags
471d89534 is described below
commit 471d89534961536185c84c75cb52666c84aa0d6a
Author: Harbs <[email protected]>
AuthorDate: Mon Aug 3 16:57:12 2026 +0300
feat(asdoc): Update ASDocComment to handle Windows line endings and add
test for private ASDoc tags
---
.../apache/royale/compiler/asdoc/royale/ASDocComment.java | 4 ++--
.../org/apache/royale/compiler/clients/TestCODEGRAPH.java | 15 +++++++++++++++
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git
a/compiler-jx/src/main/java/org/apache/royale/compiler/asdoc/royale/ASDocComment.java
b/compiler-jx/src/main/java/org/apache/royale/compiler/asdoc/royale/ASDocComment.java
index 638d558ff..89434e498 100644
---
a/compiler-jx/src/main/java/org/apache/royale/compiler/asdoc/royale/ASDocComment.java
+++
b/compiler-jx/src/main/java/org/apache/royale/compiler/asdoc/royale/ASDocComment.java
@@ -43,7 +43,7 @@ public class ASDocComment implements IASDocComment
public String commentNoEnd()
{
String s = token.getText();
- String[] lines = s.split("\n");
+ String[] lines = s.split("\r?\n");
StringBuilder sb = new StringBuilder();
int n = lines.length;
if (n == 1)
@@ -84,7 +84,7 @@ public class ASDocComment implements IASDocComment
public void compile(boolean trimlines)
{
String s = token.getText();
- String[] lines = s.split("\n");
+ String[] lines = s.split("\r?\n");
StringBuilder sb = new StringBuilder();
int n = lines.length;
if (n == 1)
diff --git
a/compiler-jx/src/test/java/org/apache/royale/compiler/clients/TestCODEGRAPH.java
b/compiler-jx/src/test/java/org/apache/royale/compiler/clients/TestCODEGRAPH.java
index 16ab2b22c..8d8d0d70b 100644
---
a/compiler-jx/src/test/java/org/apache/royale/compiler/clients/TestCODEGRAPH.java
+++
b/compiler-jx/src/test/java/org/apache/royale/compiler/clients/TestCODEGRAPH.java
@@ -32,6 +32,7 @@ import org.apache.flex.tools.FlexTool;
import org.apache.flex.tools.FlexToolGroup;
import org.apache.flex.tools.FlexToolRegistry;
import org.apache.commons.io.FileUtils;
+import org.apache.royale.compiler.asdoc.royale.ASDocComment;
import org.apache.royale.compiler.problems.ICompilerProblem;
import org.apache.royale.compiler.problems.UnknownTypeProblem;
import org.apache.royale.utils.ITestAdapter;
@@ -40,6 +41,8 @@ import org.junit.After;
import org.junit.Before;
import org.junit.Test;
+import antlr.CommonToken;
+
public class TestCODEGRAPH
{
private final ITestAdapter testAdapter =
TestAdapterFactory.getTestAdapter();
@@ -113,6 +116,18 @@ public class TestCODEGRAPH
assertEquals(goldenOutput, firstOutput);
}
+ @Test
+ public void testPrivateASDocTagWithWindowsLineEndings()
+ {
+ ASDocComment comment = new ASDocComment(new CommonToken(0, "/**\r\n *
@private\r\n */"));
+
+ comment.compile();
+
+ assertTrue(comment.hasTag("private"));
+ assertFalse(comment.hasTag("private\r"));
+ assertFalse(comment.commentNoEnd().contains("\r"));
+ }
+
@Test
public void testCompilerDefinesSelectTargetMembers() throws IOException
{