question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incorrect error in line 0 when CFML parsing encounters cfscript-like not-equals

See original GitHub issue

When scanning the following piece of code:

<cfif "foo" <> "bar">Foo</cfif>

The <> triggers a parsing error (which might be an issue in itself – I’m not sure if today’s standards allow script-like use of comparators in CFML; Update: the code does work correctly on Railo 4.2.), which erroneously appears twice in the report output, once correctly with reported line 1, once incorrectly with line 0:

$ java -jar CFLint-0.11.1-all.jar -file cfml-test.cfm -text
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
line 1:7 no viable alternative at input '"foo"<'
Error in: <cfif "foo" <> "bar">Foo</cfif> @ 1:
expression is null, parsing error
Issue
Severity:ERROR
Message code:PARSE_ERROR
        File:C:\Inbox\cflint-test\cfml-test.cfm
        Column:8
        Line:1
                Message:Unable to parse
                Variable:'null' in function:
                Expression:no viable alternative at input '"foo"<'

Severity:ERROR
Message code:PARSE_ERROR
        File:C:\Inbox\cflint-test\cfml-test.cfm
        Column:0
        Line:0
                Message:Unable to parse
                Variable:'null' in function: null
                Expression:

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ryaneberlycommented, Jan 6, 2017

That helps. I agree that the 2nd parsing error should not occur. it is fixed.

0reactions
mpaluchowskicommented, Jan 3, 2017

I’m fine if this triggers a PARSE_ERROR, but can we have just 1 such error reported and on a valid line? In other words: can we remove the one reported for “line 0”? 😃 We’re feeding these results into SonarQube and this fails now because SonarQube (rightly) reports an invalid line number.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CFLint/CHANGELOG.md at master - GitHub
Static code analysis for CFML (a linter). ... Incorrect error in line 0 when CFML parsing encounters cfscript-like not-equals #230 ...
Read more >
Troubleshooting common problems - Adobe Support
CFML syntax errors. Problem: You get an error message such as the following: Encountered "function or tag name" at line 12, column 1....
Read more >
Glitch in ColdFusion's CFML parser - Adam Cameron's Dev Blog
Adam Cameron is surprised to see ColdFusion doesn't require commas between function arguments. Sometimes.
Read more >
Invalid token '\n' found on line 31 at column 0 - Stack Overflow
The error is slightly misleading. The CF compiler is trying to parse the code but failing because of a unclosed tag / block...
Read more >
Invalid token '\n' found on line 452 at column 0
An invalid token error get thrown when ColdFusion is trying to finish parsing a TAG and either runs out of data (such as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found