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

Parse error when multiple spaces in CFML tag #243

Closed
mpaluchowski opened this issue Feb 27, 2017 · 7 comments
Closed

Parse error when multiple spaces in CFML tag #243

mpaluchowski opened this issue Feb 27, 2017 · 7 comments
Milestone

Comments

@mpaluchowski
Copy link
Contributor

The following code will produce a PARSE_ERROR at line 3:

<cfcomponent>
  <cffunction name="foo" access="public" output="false" returntype="any">
    <cfreturn  >
  </cffunction>
</cfcomponent>

because of the double space in <cfreturn >. There's no error when the tag contains either a single space <cfreturn > or no space before the closing >.

ryaneberly added a commit to cfparser/cfparser that referenced this issue Mar 4, 2017
@ryaneberly
Copy link
Contributor

fixed in cfparser develop branch.

@mpaluchowski
Copy link
Contributor Author

Looks like this issue is still present in CFLint at 1c3c2d5. It wasn't yet merged into the cfparser version that's included in this CFLint build?

@ryaneberly ryaneberly reopened this Mar 8, 2017
@ryaneberly
Copy link
Contributor

You are right. Sorry. It is included in cfparser 2.4.3 now

@mpaluchowski
Copy link
Contributor Author

This one just came back -- the code above again causes a PARSE_ERROR when there's more than a single space in the end of a tag.

@TheRealAgentK TheRealAgentK reopened this Jul 17, 2017
@ryaneberly
Copy link
Contributor

On
<cfreturn >
or something else?

The cfreturn test is still passing in cfparser.

@mpaluchowski
Copy link
Contributor Author

The command I'm running is simply:

java -jar CFLint-1.2.0-SNAPSHOT-all.jar -xml -file .\test.cfc

(built from latest CFLint dev 24538ba12f38, and the file I'm testing on is:

<cfcomponent>
  <cffunction name="foo">
    <cfreturn  >
  </cffunction>
</cfcomponent>

The errors are the same whether there's a <cfreturn > or <cfreturn /> -- it's the double space that matters. The error is specifically, in the XML:

<issue severity="ERROR" id="PARSE_ERROR" message="PARSE_ERROR" category="CFLint" abbrev="PE">
  <location file="C:\Inbox\cflint-test\.\test.cfc" fileName="test.cfc" function="" column="0" line="3" message="Unable to parse" variable="&lt;EOF&gt;">
    <Expression><![CDATA[<cfreturn  >]]></Expression>
  </location>
</issue>

and in the console:

line 1:1 mismatched input '<EOF>' expecting {BOOLEAN_LITERAL, OPEN_STRING, CONTAINS, CONTAIN, GT, GTE, LTE, LT, EQ, NEQ, OR, TO, IMP, EQV, XOR, AND, NOT, MOD, VAR, NEW, FUNCTION, DEFAULT, '.', '+', '++', '-', '--', '!!', '!', '[', '(', '{', INCLUDE, ABORT, ADMIN, THROW, RETHROW, EXIT, PARAM, PROPERTY, LOCK, THREAD, TRANSACTION, SAVECONTENT, HTTP, CFHTTP, FILE, DIRECTORY, LOOP, SETTING, QUERY, STRING, NUMERIC, BOOLEAN, ANY, ARRAY, STRUCT, PRIVATE, PUBLIC, REMOTE, PACKAGE, REQUIRED, COMPONENT, LOG, APPLET, ASSOCIATE, AUTHENTICATE, CACHE, COL, COLLECTION, CONTENT, COOKIE, ERROR, EXECUTE, FORM, FTP, GRID, GRIDCOLUMN, GRIDROW, GRIDUPDATE, HEADER, HTMLHEAD, HTTPPARAM, CFHTTPPARAM, IMPERSONATE, INDEX, INPUT, INSERT, LDAP, LOCATION, MAIL, MAILPARAM, MODULE, OBJECT, OUTPUT, POP, PROCESSINGDIRECTIVE, PROCPARAM, PROCRESULT, QUERYPARAM, REGISTRY, REPORT, SCHEDULE, SCRIPT, SEARCH, SELECT, SERVLET, SERVLETPARAM, SET, SILENT, SLIDER, STOREDPROC, TABLE, TEXTINPUT, TREE, TREEITEM, UPDATE, WDDX, ZIP, CFCUSTOM_IDENTIFIER, IDENTIFIER, INTEGER_LITERAL, '#', FLOATING_POINT_LITERAL}

@ryaneberly ryaneberly added this to the 1.2.0 milestone Jul 20, 2017
ryaneberly added a commit that referenced this issue Jul 20, 2017
@ryaneberly
Copy link
Contributor

@mpaluchowski , I see it now. Thanks! It is fixed.

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