Details

    • Number of attachments :
      2

      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
      
      
      1. Test5.as
        0.3 kB
        Freddy Mallet
      2. XMLRequester.as
        0.4 kB
        Freddy Mallet

        Issue Links

          Activity

          Hide
          Evgeny Mandrikov added a comment -

          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.

          Show
          Evgeny Mandrikov added a comment - 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.
          Hide
          Evgeny Mandrikov added a comment -

          Regarding Test5.as : I can't find confirmation that package declaration may contain semicolon (";"), FlexPMD is able to parse this file, but incorrectly - consumes "src.Test;" as package name.

          Show
          Evgeny Mandrikov added a comment - Regarding Test5.as : I can't find confirmation that package declaration may contain semicolon (";"), FlexPMD is able to parse this file, but incorrectly - consumes "src.Test;" as package name.
          Hide
          Evgeny Mandrikov added a comment -

          Regarding XMLRequester.as : "as" is a keyword in ActionScript 3, whereas not in ActionScript 2.

          Show
          Evgeny Mandrikov added a comment - Regarding XMLRequester.as : "as" is a keyword in ActionScript 3 , whereas not in ActionScript 2 .
          Hide
          Freddy Mallet added a comment -

          Manually tested !

          Show
          Freddy Mallet added a comment - Manually tested !

            People

            • Assignee:
              Evgeny Mandrikov
              Reporter:
              Freddy Mallet
            • Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: