Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"import" statement breaks parsing for scripted components #43

Closed
ajmichels opened this issue Apr 3, 2015 · 3 comments
Closed

"import" statement breaks parsing for scripted components #43

ajmichels opened this issue Apr 3, 2015 · 3 comments

Comments

@ajmichels
Copy link

If I add an import statement to the top of my CFC file I start getting all sorts of parse errors that don't make sense:

line 6:10 no viable alternative at input 'componentextends'
Stage 2!
line 6:10 no viable alternative at input 'componentextends'
line 6:42 missing ';' at 'accessors'
line 7:0 missing ';' at '{'
line 16:8 no viable alternative at input 'publicvoid'
line 18:16 extraneous input 'SomeComponent' expecting {CONTAINS, GT, GTE, LTE, LT, EQ, NEQ, OR, EQV, XOR, AND, '.', ';', '||', '&&', '[', '?'}

Here is an example file:

import my.path.SomeComponent;

/**
* Hello world.
*/
component extends="my.path.BaseComponent" accessors="true"
{


    /**
    * @type string
    */
    property name="myProp";


    public void function myFunc1()
    {
        var foo = new SomeComponent;
    }


}

If I remove the import statement it works just fine. This is however valid CFML.

@ajmichels ajmichels changed the title "import" and "new" statement breaks parsing for scripted components "import" statement breaks parsing for scripted components Apr 3, 2015
@ryaneberly
Copy link
Contributor

Thanks for reporting the parse error. I assume you are using v 0.4 from
maven?

On Fri, Apr 3, 2015 at 11:24 AM, AJ Michels [email protected]
wrote:

If I add an import my.component; statement to the top of my CFC file I
start getting all sorts of parse errors that don't make sense:

line 6:10 no viable alternative at input 'componentextends'
Stage 2!
line 6:10 no viable alternative at input 'componentextends'
line 6:42 missing ';' at 'accessors'
line 7:0 missing ';' at '{'
line 16:8 no viable alternative at input 'publicvoid'
line 18:16 extraneous input 'SomeComponent' expecting {CONTAINS, GT, GTE, LTE, LT, EQ, NEQ, OR, EQV, XOR, AND, '.', ';', '||', '&&', '[', '?'}

Here is an example file:

import my.path.SomeComponent;
/*** Hello world.*/component extends="my.path.BaseComponent" accessors="true"
{

/**    * @type string    */
property name="myProp";


public void function myFunc1()
{
    var foo = new SomeComponent;
}

}

If I remove the import and new statements it works just fine. These are
however valid CFML.


Reply to this email directly or view it on GitHub
#43.

@ajmichels
Copy link
Author

Yes, I built the JAR file using Maven. CFLint 0.4.0

I am on Mac OSX v10.10.2 running Java v1.7.0_55

@ryaneberly
Copy link
Contributor

fixed in master branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants