Details
Description
See the attached two examples for which the following parsing errors are thrown :
[ERROR] [12:17:14.909] Unable to parse source file : /Users/fmallet/sources/sonar-examples/projects/languages/flex/src/Test5.as [ERROR] [12:17:14.913] Source Snippet: --------------- --> ?package src.Test ; 2 { 3 import src.Test.Test; 4 5 6 7 class Test5 8 { 9 public function zapNoCheckLcn():Void 10 { 11 if (!EligibigityConflictController.getInstance().canDisplayWhileRecording(ssi --------------- on matcher and(DOT, IDENTIFIER) 1 : 18 : DOT expected but ";" [SEMI] found at identifier 1 : 9 : src . Test at packageDecl 1 : 1 : package at compilationUnit 1 : 0 : ? Last successful tokens: ----------------------- "Test" at 1:13 consumed by identifier "." at 1:12 consumed by identifier "src" at 1:9 consumed by identifier "package" at 1:1 consumed by packageDecl "?" at 1:0 consumed by compilationUnit [ERROR] [12:17:14.915] Unable to parse source file : /Users/fmallet/sources/sonar-examples/projects/languages/flex/src/XMLRequester.as [ERROR] [12:17:14.917] Source Snippet: --------------- --> ?class as.XMLRequester extends LoadVars { 2 3 function XMLRequester() { 4 5 6 } 7 8 function sendAndLoad(url, target, method) { 9 var _xml = new XML(); 10 _xml. --------------- on matcher identifier.is(and(IDENTIFIER, opt(one2n(and(DOT, IDENTIFIER))))) 1 : 7 : IDENTIFIER expected but "as" [AS] found at identifier 1 : 7 : at classDefinition 1 : 1 : class at packageBlockEntry 1 : 1 : at compilationUnit 1 : 0 : ? Last successful tokens: ----------------------- "class" at 1:1 consumed by classDefinition "?" at 1:0 consumed by compilationUnit
Issue Links
- relates to
-
SONARPLUGINS-2076
Support ActionScript 2
-
In fact for those two examples this is a really parser failure, but not a problem with BOM character. Indeed - file Test5.as
can be parsed after removal of ";" from declaration of package, and file XMLRequester.as
can be parsed after removal of "as." from class name, whereas BOM character stays unchanged.