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

Multiple exceptions in output #11

Closed
cfjedimaster opened this issue Jul 29, 2014 · 13 comments
Closed

Multiple exceptions in output #11

cfjedimaster opened this issue Jul 29, 2014 · 13 comments

Comments

@cfjedimaster
Copy link

Not sure why, but I get multiple exceptions when running over a folder.

-------cfml.parsing.cfscript.CFParseException: mismatched input '!' expecting RIGHTPAREN
org.antlr.runtime.tree.RewriteEmptyStreamException: rule primaryExpression
at org.antlr.runtime.tree.RewriteRuleElementStream._next(RewriteRuleElementStream.java:157)
at org.antlr.runtime.tree.RewriteRuleElementStream.nextTree(RewriteRuleElementStream.java:144)
at cfml.parsing.cfscript.CFScriptParser.memberExpressionB(CFScriptParser.java:16378)
at cfml.parsing.cfscript.CFScriptParser.memberExpression(CFScriptParser.java:16253)
at cfml.parsing.cfscript.CFScriptParser.unaryExpression(CFScriptParser.java:16136)
at cfml.parsing.cfscript.CFScriptParser.powerOfExpression(CFScriptParser.java:14837)
at cfml.parsing.cfscript.CFScriptParser.multiplicativeExpression(CFScriptParser.java:14685)
at cfml.parsing.cfscript.CFScriptParser.intDivisionExpression(CFScriptParser.java:14572)
at cfml.parsing.cfscript.CFScriptParser.modExpression(CFScriptParser.java:14450)
at cfml.parsing.cfscript.CFScriptParser.additiveExpression(CFScriptParser.java:14304)
at cfml.parsing.cfscript.CFScriptParser.concatenationExpression(CFScriptParser.java:14191)
at cfml.parsing.cfscript.CFScriptParser.equalityExpression(CFScriptParser.java:12382)
at cfml.parsing.cfscript.CFScriptParser.notExpression(CFScriptParser.java:12304)
at cfml.parsing.cfscript.CFScriptParser.andExpression(CFScriptParser.java:12141)
at cfml.parsing.cfscript.CFScriptParser.orExpression(CFScriptParser.java:12019)
at cfml.parsing.cfscript.CFScriptParser.xorExpression(CFScriptParser.java:11908)
at cfml.parsing.cfscript.CFScriptParser.equivalentExpression(CFScriptParser.java:11797)
at cfml.parsing.cfscript.CFScriptParser.impliesExpression(CFScriptParser.java:11549)
at cfml.parsing.cfscript.CFScriptParser.assignmentExpression(CFScriptParser.java:10662)
at cfml.parsing.cfscript.CFScriptParser.localAssignmentExpression(CFScriptParser.java:10588)
at cfml.parsing.cfscript.CFScriptParser.statement(CFScriptParser.java:4528)
at cfml.parsing.cfscript.CFScriptParser.compoundStatement(CFScriptParser.java:4126)
at cfml.parsing.cfscript.CFScriptParser.functionDeclaration(CFScriptParser.java:1888)
at cfml.parsing.cfscript.CFScriptParser.element(CFScriptParser.java:1605)
at cfml.parsing.cfscript.CFScriptParser.componentGuts(CFScriptParser.java:4238)
at cfml.parsing.cfscript.CFScriptParser.componentDeclaration(CFScriptParser.java:678)
at cfml.parsing.cfscript.CFScriptParser.scriptBlock(CFScriptParser.java:524)
at cfml.parsing.CFMLParser.parseScript(CFMLParser.java:315)
at com.cflint.CFLint.process(CFLint.java:147)
at com.cflint.CFLint.scan(CFLint.java:109)
at com.cflint.CFLint.scan(CFLint.java:103)
at com.cflint.CFLint.scan(CFLint.java:103)
at com.cflint.CFLint.scan(CFLint.java:103)
at com.cflint.CFLint.scan(CFLint.java:103)
at com.cflint.CFLint.scan(CFLint.java:103)
at com.cflint.CFLint.scan(CFLint.java:97)
at com.cflint.main.CFLintMain.execute(CFLintMain.java:242)
at com.cflint.main.CFLintMain.main(CFLintMain.java:157)

@ryaneberly
Copy link
Contributor

Thanks Ray, I guess Job 1 is making that exception a little more informative. Printing information like while file (and code statment) is causing the problem.

however, in the meantime if you happen to know which source is causing the issue, I'd like to see it.

Fixing this is ultimately going to involve getting into the ANTLR grammar.

@cfjedimaster
Copy link
Author

I'll attach one of the files causing the error. Although shoot - I just realized, I can't see the file name. :( I ran this on a directory so in theory I could try running on a file, one at a time, but that would be a bit of work. Can you ensure the next build throws out the filename too? Or heck, put a temp build up for me to try?

@jjames967
Copy link
Collaborator

Hi Raymond,

While running the parser/looking at the grammar, I’ve noticed some issues. I’ve only recently started on working with CFLint, but I’m hoping to combine the dictionary, parser, and CFLint into one project. This should vastly improve the ability to track down issues with the grammar and correct issues.

I’ve also ran into similar issues with parsing errors. That’s a very good suggestion about printing the file name. That should be fairly easy if my memory is correct. I’ll look into it tomorrow.

I’ve also correct “Cold Fusion” to “ColdFusion”. Ryan will get back to me about the logo availability. Otherwise, I’ll be remaking a vector formatted image if none is available.

Ryan and I will be discussing ideas about where CFLint should go next week. I’m currently leaning more towards speed, then perhaps building on simplifying rule-making.

All your input helps,

Jerron

Sent from Windows Mail

From: Raymond Camden
Sent: ‎Tuesday‎, ‎July‎ ‎29‎, ‎2014 ‎8‎:‎02‎ ‎PM
To: ryaneberly/CFLint

I'll attach one of the files causing the error. Although shoot - I just realized, I can't see the file name. :( I ran this on a directory so in theory I could try running on a file, one at a time, but that would be a bit of work. Can you ensure the next build throws out the filename too? Or heck, put a temp build up for me to try?


Reply to this email directly or view it on GitHub.

@cfjedimaster
Copy link
Author

As an aside, I want to wrap this in a CFB extension. Any objections?

On Tue, Jul 29, 2014 at 10:11 PM, jjames967 [email protected]
wrote:

Hi Raymond,

While running the parser/looking at the grammar, I’ve noticed some issues.
I’ve only recently started on working with CFLint, but I’m hoping to
combine the dictionary, parser, and CFLint into one project. This should
vastly improve the ability to track down issues with the grammar and
correct issues.

I’ve also ran into similar issues with parsing errors. That’s a very good
suggestion about printing the file name. That should be fairly easy if my
memory is correct. I’ll look into it tomorrow.

I’ve also correct “Cold Fusion” to “ColdFusion”. Ryan will get back to me
about the logo availability. Otherwise, I’ll be remaking a vector formatted
image if none is available.

Ryan and I will be discussing ideas about where CFLint should go next
week. I’m currently leaning more towards speed, then perhaps building on
simplifying rule-making.

All your input helps,

Jerron

Sent from Windows Mail

From: Raymond Camden
Sent: ‎Tuesday‎, ‎July‎ ‎29‎, ‎2014 ‎8‎:‎02‎ ‎PM
To: ryaneberly/CFLint

I'll attach one of the files causing the error. Although shoot - I just
realized, I can't see the file name. :( I ran this on a directory so in
theory I could try running on a file, one at a time, but that would be a
bit of work. Can you ensure the next build throws out the filename too? Or
heck, put a temp build up for me to try?


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub
#11 (comment).

Raymond Camden, Web Developer for Adobe

Email : [email protected]
Blog : www.raymondcamden.com
Twitter: raymondcamden

@jjames967
Copy link
Collaborator

Out of curiosity, what CF server are you using? Is Adobe, Railo, Blue Dragon...?

@ryaneberly
Copy link
Contributor

@cfb: No objection :-). I think its a great idea. you suggested that a while back but I haven't pursued it. CFLint supports scanning a single file. One of the users wrote an extension for vim.

@ryaneberly
Copy link
Contributor

I can't attach the jar directly here, but you can replace your CFLint-0.1.8.jar with https://drive.google.com/file/d/0B8KUYT-JUnurNDB3dk1NUzVRZUE/edit?usp=sharing
and it will print the offending file name.

@cfjedimaster
Copy link
Author

Thanks for the new jar, going to post some files throwing errors now.

Ok, two files: https://www.dropbox.com/sh/vfvw34mk2d4s7wi/AAC7885ssgZnXeNx-zS_Y_3qa/cflint

@ryaneberly
Copy link
Contributor

Two errors in the following, both are a bit interesting:
component
output = false
hint = "I run a suite of test cases."
{

public any function runTestCases( required string testCaseList ) {
   runTestsInTestCase( new "specs.#testCaseName#"() );  // ERROR with this LINE

}

private boolean function isTestMethodName( required string methodName ) {
    // All test methods must start with the term, "test". 
    return( !! reFindNoCase( "^test", methodName ) );    // ERROR with !! here

}

}

@ryaneberly
Copy link
Contributor

And trouble with anonymous function in test.cfm:

arrayEach(dirs, function(d) { directoryDelete(d,true); });

@ryaneberly
Copy link
Contributor

Hey Raymond,
Per https://groups.google.com/forum/#!topic/cfeclipse-users/7uU8fPsRUoM
the CF10 dictionary (and presumbly) CF11's are bundled with Coldfusion Builder.

Any (copyright) issue with using those in this project?

@cfjedimaster
Copy link
Author

I can't answer that. You could just include them with a note about where
they came from. The most you will get is an email asking you to stop.

I do not speak for Adobe, I just say do it.

On Sat, Aug 2, 2014 at 7:25 PM, ryaneberly [email protected] wrote:

Hey Raymond,
Per https://groups.google.com/forum/#!topic/cfeclipse-users/7uU8fPsRUoM
the CF10 dictionary (and presumbly) CF11's are bundled with Coldfusion
Builder.

Any (copyright) issue with using those in this project?


Reply to this email directly or view it on GitHub
#11 (comment).

Raymond Camden, Web Developer for Adobe

Email : [email protected]
Blog : www.raymondcamden.com
Twitter: raymondcamden

ryaneberly added a commit that referenced this issue Aug 5, 2014
 
print the file name when reporting an exception
@ryaneberly
Copy link
Contributor

fixed the parsing issues in the antlr4 branch.
Hope to release soon.

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

3 participants