cflint / CFLint

Static code analysis for CFML (a linter)
BSD 3-Clause "New" or "Revised" License
173 stars 84 forks source link

Error in parsing AND IndexOutOfBoundsException: token index -1 out of range 0..1 #666

Open Vintic opened 4 years ago

Vintic commented 4 years ago

Obtain this error: Error in parsing : in on tag cfparam java.lang.IndexOutOfBoundsException: token index -1 out of range 0..1 at org.antlr.v4.runtime.BufferedTokenStream.get(BufferedTokenStream.java:186) at com.cflint.CFLint.syntaxError(CFLint.java:1600) ...

Code to check:

<cfparam name="in" default=-1>
<html>
<body>
<font color="#6e7b8b" face="Arial" size="5"><b><cfif in>Welcome<cfelse>Goodbye</cfif>:</b></font>
</body>
</html>
KamasamaK commented 4 years ago

This is due to using that variable name in. I think it is being interpreted as a keyword, but in is only a keyword in script syntax and in Lucee it's not even reserved,