abstract class
Analyzer::Cfml::CfmlEngine
- Analyzer::Cfml::CfmlEngine
- Analyzer
- Reference
- Object
Overview
Shared CFML parsing layer.
See AGENTS.md ยง"Analyzer Layering": this owns file selection and the syntax handling every CFML adapter needs, so framework analyzers (Taffy, ColdBox, Wheels, FW/1) consume components and functions rather than re-implementing tag/script parsing.
The two syntaxes are the whole problem. CFML is written either as
tags (<cffunction name="x" access="remote">) or as cfscript
(remote string function x()), the two mix inside a single file, and
everything is case-insensitive.
Direct Known Subclasses
- Analyzer::Cfml::Coldbox
- Analyzer::Cfml::Fw1
- Analyzer::Cfml::Pure
- Analyzer::Cfml::Taffy
- Analyzer::Cfml::Wheels
Defined in:
analyzer/engines/cfml_engine.crConstant Summary
-
CFARGUMENT_TAG_RE =
/<cfargument\b([\s\S]*?)>/i -
CFCOMPONENT_TAG_RE =
/<cfcomponent\b([\s\S]*?)>/i -
Tags may span lines and pad their
=for alignment, so attributes are matched with\s*=\s*and tag bodies with[\s\S]*?. -
CFFUNCTION_TAG_RE =
/<cffunction\b([\s\S]*?)>/i -
HTTP_VERBS =
Set {"GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"} -
Verbs a CFML framework can register. Route DSLs take verbs as free text, so a value outside this set is not turned into a method.
-
NAMED_ARGUMENT_RE =
/\A([A-Za-z_]\w*)\s*[:=]\s*(.+)\z/m -
SCRIPT_COMPONENT_HEADER_LIMIT =
2000 -
A component header is a handful of attributes; bound the scan so a file with no opening brace cannot walk the whole content.
-
SCRIPT_COMPONENT_RE =
/(?<![\w.])component\b/i -
component ... {header in script syntax, and a function declaration with its trailing attribute list up to the body brace. -
SCRIPT_FUNCTION_RE =
/(?<![\w.])function\s+(\w+)\s*\(/i -
TAG_ATTR_RE =
/([\w:.-]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/ -
Attribute names carry
:and-in the wild (taffy:uri,data-required), and values use either quote style. -
TEST_COMPONENT_RE =
/.+(?:Test|Spec)\.cfc\z/i -
TestBox names suites
<Something>Test.cfc/<Something>Spec.cfc. The leading.+is load-bearing: a component named exactlyTest.cfcis a demo, not a suite (fw1 ships one that declares a realremotemethod), and an anchoredends_with?swallowed it.