Skip to content

Commit

Permalink
https://github.com/cflint/CFLint/issues/249
Browse files Browse the repository at this point in the history
  • Loading branch information
ryaneberly committed Mar 11, 2017
1 parent 790dc6e commit a0fa3d4
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cfml.dictionary/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.github.cfparser</groupId>
<artifactId>cfparser</artifactId>
<version>2.4.2</version>
<version>2.4.3</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion cfml.parsing/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.github.cfparser</groupId>
<artifactId>cfparser</artifactId>
<version>2.4.2</version>
<version>2.4.3</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import cfml.CFSCRIPTParser.ParentheticalMemberExpressionContext;
import cfml.CFSCRIPTParser.PrimaryExpressionContext;
import cfml.CFSCRIPTParser.PrimaryExpressionIRWContext;
import cfml.CFSCRIPTParser.ReservedWordContext;
import cfml.CFSCRIPTParser.SpecialWordContext;
import cfml.CFSCRIPTParser.StringLiteralContext;
import cfml.CFSCRIPTParser.StringLiteralPartContext;
Expand Down Expand Up @@ -599,4 +600,9 @@ public CFExpression visitSpecialWord(SpecialWordContext ctx) {
return new CFIdentifier(ctx.start, ctx.getChild(0).getText());
}

@Override
public CFExpression visitReservedWord(ReservedWordContext ctx) {
return new CFIdentifier(ctx.start, ctx.getChild(0).getText());
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function foo() {
var bar = {
function = ''
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*===TOKENS===*/
FUNCTION <function>
IDENTIFIER <foo>
'(' <(>
')' <)>
'{' <{>
VAR <var>
IDENTIFIER <bar>
'=' <=>
'{' <{>
FUNCTION <function>
'=' <=>
OPEN_STRING <'>
CLOSE_STRING <'>
'}' <}>
';' <;>
'}' <}>
/*===TREE===*/
(scriptBlock
(element
(functionDeclaration
function
(identifier foo)
(
parameterList
)
(compoundStatement
{
(statement
(localAssignmentExpression
var
(multipartIdentifier (identifier bar))
=
(startExpression
(compareExpression
(baseExpression
(unaryExpression
(primaryExpression
(implicitStruct
{
(implicitStructElements
(implicitStructExpression
(implicitStructKeyExpression (reservedWord (cfscriptKeywords function)))
=
(compareExpression
(baseExpression
(unaryExpression (primaryExpression (literalExpression (stringLiteral ' '))))
)
)
)
)
}
)
)
)
)
)
)
)
;
)
}
)
)
)
)
/*======*/
/*===DECOMPILE===*/
public function foo() {
var bar = {function:''};

}
/*======*/
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.cfparser</groupId>
<artifactId>cfparser</artifactId>
<version>2.4.2</version>
<version>2.4.3</version>
<packaging>pom</packaging>

<name>coldfusion-parser</name>
Expand Down

0 comments on commit a0fa3d4

Please sign in to comment.