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

joshtynjala 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 c456f43  compiler: fix issue where automatic semicolon insertion did 
not account for comment tokens
c456f43 is described below

commit c456f432382034f8238d7d0ea0adce291b06e96f
Author: Josh Tynjala <[email protected]>
AuthorDate: Mon Jun 28 14:28:55 2021 -0700

    compiler: fix issue where automatic semicolon insertion did not account for 
comment tokens
    
    Comment tokens are turned off by default, so that's why this was not 
noticed. But they may be optionally turned on for tooling that uses the 
compiler as a data source. This commit ensures that the behavior of automatic 
semicolon insertion is consistent whether comments are on or off.
---
 .../org/apache/royale/compiler/internal/parsing/as/BaseASParser.java  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/compiler/src/main/java/org/apache/royale/compiler/internal/parsing/as/BaseASParser.java
 
b/compiler/src/main/java/org/apache/royale/compiler/internal/parsing/as/BaseASParser.java
index 7e02f6a..99fbc0b 100644
--- 
a/compiler/src/main/java/org/apache/royale/compiler/internal/parsing/as/BaseASParser.java
+++ 
b/compiler/src/main/java/org/apache/royale/compiler/internal/parsing/as/BaseASParser.java
@@ -1818,7 +1818,9 @@ abstract class BaseASParser extends LLkParser implements 
IProblemReporter
     private boolean handleParsingError(final RecognitionException ex, final 
ASToken current, final ASToken errorToken, final int endToken)
     {
         // Ignore ASDoc problems.
-        if (current.getType() == ASTokenTypes.TOKEN_ASDOC_COMMENT)
+        if (current.getType() == ASTokenTypes.TOKEN_ASDOC_COMMENT
+                || current.getType() == 
ASTokenTypes.HIDDEN_TOKEN_SINGLE_LINE_COMMENT
+                || current.getType() == 
ASTokenTypes.HIDDEN_TOKEN_MULTI_LINE_COMMENT)
         {
             consume();
             return true;

Reply via email to