-
Notifications
You must be signed in to change notification settings - Fork 84
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
parse error "can't look backwards more than one token in this stream" #24
Comments
Exclude rules are supported. When I tried it just now, I got multiple errors in the result html for a I'll look at these tonight. If you are familiar with Java and feeling Thanks for the input. On Wed, Dec 3, 2014 at 5:24 AM, Axel Bons [email protected] wrote:
|
stream" (#24) Fix NPE exception in bug reporting
I enhanced CFLintFilter to support excludes by 'expression'. That won't be available for download until we do a new release, but you can build it yourself. You can currently do excludes based on: All these variables already support regex (of the java String.matches() variety) So I suggest using the current release and adding something like, to ignore PARSE_ERROR on specific file.: to /etc/cflintexclude.json you'll see there's already a pretty broad rule in there by default that ignores violations in the init() function. We should probably narrow that a bit to just VAR missing violations. |
The excluderule which worked for me was: With the excluderule the warning won't be in the results. var user = userservice"getuser"; The missing_var warning for the 2nd line won't be in the results. |
jjames967 has been looking at enhancing the CF parser that we're using - that is a significant task. We use the same parser that is used by CFEclipse, and it has quite a few issues that could be improved upon. Ideally we'd just fix this parsing error. However, there are a some work-arounds. cfscript gets consumed all at once. If your cfc is not pure cfscript, and your code is inside a tag, you can break the cfscript into pieces. .... However, I dislike when the limitations of a tool influence coding like that. I agree it would be nice if the parser just failed on a single line and consumed the the remaining ones successfully. I'll think about that, maybe it's doable even within the current parser's limitations. |
fixed in antlr4 branch.. hopefully releasing soon. |
var user = userservice"getuser"; --doesn't work
var user = userservice.getuser(); --works
The above 2 lines are both fine syntax. But the first line gives the parse error "can't look backwards more than one token in this stream". I can't use the 2nd line, because I use a variable within the brackets.
Is it possible to add my own excludeRule?
For instance with a regular expression .*
The text was updated successfully, but these errors were encountered: