You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@royale.apache.org by GitBox <gi...@apache.org> on 2019/01/11 21:26:57 UTC

[GitHub] sobotklp opened a new issue #70: Block comments that start with /** confuse compiler

sobotklp opened a new issue #70: Block comments that start with /** confuse compiler
URL: https://github.com/apache/royale-compiler/issues/70
 
 
   Copying this issue from https://github.com/apache/royale-asjs/issues/368, since it may be more appropriate for this project.
   
   I notice that when using a block comment that begins with `/**`, the compiler spits out some confusing errors. Here's a small example:
   
   ```
   package {
           public class Main {
   
                   public function Main () {
   
                           console.log("Hi Royale!");
                   }
   
                   public function testSwitch(name:String):Number {
                           switch(name) {
                                   /**
                                    * IF I REMOVE THIS COMMENT, COMPILATION WORKS
                                    */
                                   case "why-you-no-like-me-bro?":
                                           break;
                                   default:
                                           return 0;
                           }
                           return 1;
                   }
           }
   }
   ```
   
   When I compile this code using `asjsc -debug=true --targets=js src/Main.as`, I get the following compile errors:
   ```
   src/Main.as(14): col: 35 Syntax error: Label must be a simple identifier.
   
   				case "why-you-no-like-me-bro?":
   				                              ^
   
   src/Main.as(15): col: 6 Error: Target of break statement was not found.
   
   					break;
   					^
   
   src/Main.as(16): col: 5 Syntax error: Expected SCOPE_CLOSE but got 'default'
   
   				default:
   				^
   ``` 
   
   If I remove the comment in that code, or change from `/**` to `/*`, compilation proceeds as normal.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services