Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion cfml.parsing/src/main/antlr4/cfml/CFSCRIPTParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,6 @@ arraySlice

functionCall
:(identifier | specialWord) LEFTPAREN argumentList RIGHTPAREN
body=compoundStatement?
;
simpleFunctionCall
:(identifier | specialWord) LEFTPAREN argumentList RIGHTPAREN
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// A function call as an attribute value. The call's own optional block body used to
// swallow the tag's body, leaving the tag with nothing to match.
query name="results" cachedWithin=createTimeSpan(0,0,0,5) {
echo("select 1");
}
// The same tag with a plain attribute value, and with no body at all.
query name="other" cachedWithin=timeout {
echo("select 2");
}
cfdirectory directory=expandPath("/tmp") action="list";
Original file line number Diff line number Diff line change
@@ -0,0 +1,307 @@
/*===TOKENS===*/
Hidden:LINE_COMMENT <// A function call as an attribute value. The call's own optional block body used to>
Hidden:LINE_COMMENT <// swallow the tag's body, leaving the tag with nothing to match.>
QUERY <query>
IDENTIFIER <name>
'=' <=>
OPEN_STRING <">
STRING_LITERAL <results>
CLOSE_STRING <">
IDENTIFIER <cachedWithin>
'=' <=>
IDENTIFIER <createTimeSpan>
'(' <(>
INTEGER_LITERAL <0>
',' <,>
INTEGER_LITERAL <0>
',' <,>
INTEGER_LITERAL <0>
',' <,>
INTEGER_LITERAL <5>
')' <)>
'{' <{>
Hidden:NEWLINE <>
IDENTIFIER <echo>
'(' <(>
OPEN_STRING <">
STRING_LITERAL <select 1>
CLOSE_STRING <">
')' <)>
';' <;>
Hidden:NEWLINE <>
'}' <}>
Hidden:NEWLINE <>
Hidden:LINE_COMMENT <// The same tag with a plain attribute value, and with no body at all.>
QUERY <query>
IDENTIFIER <name>
'=' <=>
OPEN_STRING <">
STRING_LITERAL <other>
CLOSE_STRING <">
IDENTIFIER <cachedWithin>
'=' <=>
IDENTIFIER <timeout>
'{' <{>
Hidden:NEWLINE <>
IDENTIFIER <echo>
'(' <(>
OPEN_STRING <">
STRING_LITERAL <select 2>
CLOSE_STRING <">
')' <)>
';' <;>
Hidden:NEWLINE <>
'}' <}>
Hidden:NEWLINE <>
DIRECTORY <cfdirectory>
DIRECTORY <directory>
'=' <=>
IDENTIFIER <expandPath>
'(' <(>
OPEN_STRING <">
STRING_LITERAL </tmp>
CLOSE_STRING <">
')' <)>
IDENTIFIER <action>
'=' <=>
OPEN_STRING <">
STRING_LITERAL <list>
CLOSE_STRING <">
';' <;>
Hidden:NEWLINE <>
/*===TREE===*/
(scriptBlock
(element
(statement
(tagOperatorStatement
(cfmlfunctionStatement
(cfmlFunction query)
(paramStatementAttributes
(param
(multipartIdentifier (identifier name))
=
(startExpression
(baseExpression
(unaryExpression
(primaryExpression
(literalExpression (stringLiteral " (stringLiteralPart results) "))
)
)
)
)
)
(param
(multipartIdentifier (identifier cachedWithin))
=
(startExpression
(baseExpression
(unaryExpression
(memberExpression
(functionCall
(identifier createTimeSpan)
(
(argumentList
(argument
(startExpression
(baseExpression (unaryExpression (primaryExpression (literalExpression 0))))
)
)
,
(argument
(startExpression
(baseExpression (unaryExpression (primaryExpression (literalExpression 0))))
)
)
,
(argument
(startExpression
(baseExpression (unaryExpression (primaryExpression (literalExpression 0))))
)
)
,
(argument
(startExpression
(baseExpression (unaryExpression (primaryExpression (literalExpression 5))))
)
)
)
)
)
)
)
)
)
)
)
(compoundStatement
{
(statement
(startExpression
(baseExpression
(unaryExpression
(memberExpression
(functionCall
(identifier echo)
(
(argumentList
(argument
(startExpression
(baseExpression
(unaryExpression
(primaryExpression
(literalExpression (stringLiteral " (stringLiteralPart select 1) "))
)
)
)
)
)
)
)
)
)
)
)
)
;
)
}
)
)
)
)
)
(element
(statement
(tagOperatorStatement
(cfmlfunctionStatement
(cfmlFunction query)
(paramStatementAttributes
(param
(multipartIdentifier (identifier name))
=
(startExpression
(baseExpression
(unaryExpression
(primaryExpression
(literalExpression (stringLiteral " (stringLiteralPart other) "))
)
)
)
)
)
(param
(multipartIdentifier (identifier cachedWithin))
=
(startExpression
(baseExpression (unaryExpression (memberExpression (identifier timeout))))
)
)
)
(compoundStatement
{
(statement
(startExpression
(baseExpression
(unaryExpression
(memberExpression
(functionCall
(identifier echo)
(
(argumentList
(argument
(startExpression
(baseExpression
(unaryExpression
(primaryExpression
(literalExpression (stringLiteral " (stringLiteralPart select 2) "))
)
)
)
)
)
)
)
)
)
)
)
)
;
)
}
)
)
)
)
)
(element
(statement
(tagOperatorStatement
(cfmlfunctionStatement
(cfmlFunction cfdirectory)
(paramStatementAttributes
(param
(multipartIdentifier (identifier (cfmlFunction directory)))
=
(startExpression
(baseExpression
(unaryExpression
(memberExpression
(functionCall
(identifier expandPath)
(
(argumentList
(argument
(startExpression
(baseExpression
(unaryExpression
(primaryExpression
(literalExpression (stringLiteral " (stringLiteralPart /tmp) "))
)
)
)
)
)
)
)
)
)
)
)
)
)
(param
(multipartIdentifier (identifier action))
=
(startExpression
(baseExpression
(unaryExpression
(primaryExpression
(literalExpression (stringLiteral " (stringLiteralPart list) "))
)
)
)
)
)
)
;
)
)
)
)
)
/*======*/
/*===DECOMPILE===*/
{
query cachedWithin=createTimeSpan(0, 0, 0, 5) name='results'{
echo('select 1');

};
query cachedWithin=timeout name='other'{
echo('select 2');

};
cfdirectory action='list' directory=expandPath('/tmp');;

}
/*======*/
Loading