jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
Signup
Sonar Plugins
  • Sonar Plugins
  • SONARPLUGINS-2072

Unable to parse some files

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: FLEX-1.2
  • Component/s: Flex
  • Labels:
    None
  • 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

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. File
    Test5.as
    20/Jul/12 5:21 AM
    0.3 kB
    Freddy Mallet
  2. File
    XMLRequester.as
    20/Jul/12 5:21 AM
    0.4 kB
    Freddy Mallet

Issue Links

relates to

New Feature - A new feature of the product, which has yet to be developed. SONARPLUGINS-2076 Support ActionScript 2

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Evgeny Mandrikov added a comment - 14/Sep/12 1:02 PM

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 - 14/Sep/12 1:02 PM 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
Permalink
Evgeny Mandrikov added a comment - 16/Sep/12 7:33 AM

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 - 16/Sep/12 7:33 AM 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
Permalink
Evgeny Mandrikov added a comment - 17/Sep/12 8:40 AM

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

Show
Evgeny Mandrikov added a comment - 17/Sep/12 8:40 AM Regarding XMLRequester.as : "as" is a keyword in ActionScript 3 , whereas not in ActionScript 2 .
Hide
Permalink
Freddy Mallet added a comment - 19/Sep/12 9:14 AM

Manually tested !

Show
Freddy Mallet added a comment - 19/Sep/12 9:14 AM Manually tested !

People

  • Assignee:
    Evgeny Mandrikov
    Reporter:
    Freddy Mallet
Vote (2)
Watch (3)

Dates

  • Created:
    20/Jul/12 5:21 AM
    Updated:
    19/Sep/12 11:20 AM
    Resolved:
    17/Sep/12 10:26 AM
  • Atlassian JIRA (v5.2.7#850-sha1:b2af0c8)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.