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 2021/06/24 17:33:24 UTC

[GitHub] [royale-compiler] joshtynjala opened a new issue #189: ASDoc comments should be ignored (as if they were regular comments) when they appear in unexpected places

joshtynjala opened a new issue #189:
URL: https://github.com/apache/royale-compiler/issues/189


   Example:
   
   ```as3
   package
   {
   	public class CommentInsideFunctionParameters
   	{
   		public function CommentInsideFunctionParameters(param:Object=null /** asdoc comment is bad? **/)
   		{
   		}
   	}
   }
   ```
   
   The Royale compiler gives the following error, but the Flex SDK compiler treated it as a normal comment:
   
   > ')' is not allowed here
   
   But this code gives no errors:
   
   ```as3
   package
   {
   	public class CommentInsideFunctionParameters
   	{
   		public function CommentInsideFunctionParameters(param:Object=null /* regular comment is okay! */)
   		{
   		}
   	}
   }
   ```
   
   RawASTokenizer.lex creates a TOKEN_ASDOC_COMMENT for asdic comments, but it doesn't create a token for regular comments (unless a particular flag is enabled). ASParser.g can handle this token in a few places, but if it encounters the token somewhere it doesn't expect, it results in the error above.
   
   In the case above, `formalParameters` or `formal` in ASParser.g is where the ASDoc comment is unexpected, and that might be easy enough to work around, but there are many other places where you could try to add an ASDoc comment, and it would also result in errors.
   
   A real fix may involve adding a new flag to ignore ASDoc comments (in the same way that regular comments are ignored or parsed), except when they are actually needed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [royale-compiler] greg-dove commented on issue #189: ASDoc comments should be ignored (as if they were regular comments) when they appear in unexpected places

Posted by GitBox <gi...@apache.org>.
greg-dove commented on issue #189:
URL: https://github.com/apache/royale-compiler/issues/189#issuecomment-926222052


   I think this is related: I have seen similar issues with ASDoc comments before an else statement 
   It will give a Syntax Error saying expected SCOPE_CLOSE but got 'else' (or similar). Swapping to normal comment, as described above for parameters, fixes it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@royale.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org