Search in sources :

Example 11 with CFExpression

use of cfml.parsing.cfscript.CFExpression in project CFLint by cflint.

the class ComponentHintChecker method expression.

/**
 * Parse a CF component deceleration to see if it's missing a hint.
 */
@Override
public void expression(final CFScriptStatement expression, final Context context, final BugList bugs) {
    if (expression instanceof CFCompDeclStatement) {
        final CFCompDeclStatement compDeclStatement = (CFCompDeclStatement) expression;
        final CFExpression hintAttribute = CFTool.convertMap(compDeclStatement.getAttributes()).get("hint");
        if (hintAttribute == null) {
            checkHint(COMPONENT_HINT_MISSING, context.calcComponentName(), expression, context);
        }
    }
}
Also used : CFCompDeclStatement(cfml.parsing.cfscript.script.CFCompDeclStatement) CFExpression(cfml.parsing.cfscript.CFExpression)

Example 12 with CFExpression

use of cfml.parsing.cfscript.CFExpression in project CFLint by cflint.

the class FunctionHintChecker method expression.

/**
 * Parse a CF function deceleration to see if it's missing a hint.
 */
@Override
public void expression(final CFScriptStatement expression, final Context context, final BugList bugs) {
    if (expression instanceof CFFuncDeclStatement) {
        final CFFuncDeclStatement funcDeclStatement = (CFFuncDeclStatement) expression;
        final CFExpression hintAttribute = CFTool.convertMap(funcDeclStatement.getAttributes()).get("hint");
        if (hintAttribute == null) {
            checkHint(FUNCTION_HINT_MISSING, context.getFunctionName(), expression, context);
        }
    }
}
Also used : CFFuncDeclStatement(cfml.parsing.cfscript.script.CFFuncDeclStatement) CFExpression(cfml.parsing.cfscript.CFExpression)

Aggregations

CFExpression (cfml.parsing.cfscript.CFExpression)12 CFIdentifier (cfml.parsing.cfscript.CFIdentifier)5 CFFullVarExpression (cfml.parsing.cfscript.CFFullVarExpression)4 ParseException (cfml.parsing.reporting.ParseException)4 CFLintScanException (com.cflint.exception.CFLintScanException)4 CFLintScanner (com.cflint.plugins.CFLintScanner)4 IOException (java.io.IOException)4 CFVarDeclExpression (cfml.parsing.cfscript.CFVarDeclExpression)3 CFFuncDeclStatement (cfml.parsing.cfscript.script.CFFuncDeclStatement)3 CFScriptStatement (cfml.parsing.cfscript.script.CFScriptStatement)3 Context (com.cflint.plugins.Context)3 ContextMessage (com.cflint.plugins.Context.ContextMessage)3 ArrayList (java.util.ArrayList)3 CFFunctionExpression (cfml.parsing.cfscript.CFFunctionExpression)2 CFMember (cfml.parsing.cfscript.CFMember)2 CFCompDeclStatement (cfml.parsing.cfscript.script.CFCompDeclStatement)2 CFLintStructureListener (com.cflint.plugins.CFLintStructureListener)2 File (java.io.File)2 List (java.util.List)2 Pattern (java.util.regex.Pattern)2