Open TheRealAgentK opened 7 years ago
I have not used Lucee extensively, so if anyone can comment on syntax differences that would need to be taken into consideration that would be great as parse errors would be the biggest issue. Currently, I know that Lucee makes semicolons optional (#104) [EDIT: This is now supported in ACF 2018] and allows for trailing commas (#263 and #365). There is also the proposal for an HTML island, but as far as I am aware nothing has come of it. [EDIT: It's been deployed] Lucee supports the ACF syntax as well in most cases for compatibility, but it also has its own syntax variations in some cases.
cfparser/cfparser#123
ACF does not support the arrow function syntax at this time, but it is marked as "To Fix". [EDIT: Support added in CF2018U5 via CF-4198396].
ACF
g = function(x,y) {
return x*y;
}
Lucee-only
g = (x,y) => x*y
cfparser/cfparser#128
===
/!==
: Checks value and typeCT
: Alias for CONTAINS
NCT
: Alias for DOES NOT CONTAIN
I am also testing but a big one (that I think more developers would use) would be
<cfscript>
dump(SERVER);
</cfscript>
There is also the ternary and elvis operators:
var item = FileExists(thing) ? "Yep" : "Nope";
var item = rockstar?:"Elvis";
More info here: http://docs.lucee.org/guides/developing-with-lucee-server/operators.html
The ternary and elvis operators are not exclusive to Lucee, so they should be supported regardless.
The dump
function is a good example because there is a rule to avoid writeDump
(in production code), but does not account for dump
which is a Lucee-exclusive alias.
Apologies, haven't used latest versions of ACF in anger for a while so not sure they are in.
There are rules I want to add too, but will get to that once #317 gets done so I can get contributing.
Yeah, what would it take to add arrow function support? Currently CFLint throws a NullPointerException when it encounters them.
(I can open this as a new issue if you'd like - I just thought I'd put it here since you mentioned it above.)
https://bitbucket.org/michaelborn_me/cfevents/addon/pipelines/home#!/results/4
Hi!
It's seems the arrow function is not supported yet :cry:. info
And, here is another syntax from Lucee that is no well handled.
This is the oredered struct definition using array brackets: info
var z = [
a = 1,
b = 2
];
That is equivalent to this ugly piece of code:
var z = new struct( 'ordered' );
z.a = 1;
z.b = 2;
Thanks!
it seems tag islands cause a NPE
Caused by: java.lang.NullPointerException at cfml.parsing.cfscript.walker.CFScriptStatementVisitor.visitForStatement(CFScriptStatementVisitor.java:340) at cfml.parsing.cfscript.walker.CFScriptStatementVisitor.visitForStatement(CFScriptStatementVisitor.java:102) at cfml.CFSCRIPTParser$ForStatementContext.accept(CFSCRIPTParser.java:2955) at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:46)
Collection ticket for discussion around Lucee and CFLint