use of cfml.parsing.cfscript.CFStructExpression in project CFLint by cflint.
the class StructKeyChecker method expression.
@Override
public void expression(final CFExpression expression, final Context context, final BugList bugs) {
if (expression instanceof CFStructExpression) {
CFStructExpression structExpression = (CFStructExpression) expression;
for (Object element : structExpression.getElements()) {
CFStructElementExpression structKeyExpression = (CFStructElementExpression) element;
String firstToken = structKeyExpression.getKey().getToken().getText();
if (!"'".equals(firstToken) && !"\"".equals(firstToken)) {
context.addMessage("UNQUOTED_STRUCT_KEY", structKeyExpression.getKey().Decompile(0));
}
}
}
}
Aggregations