use of cfml.parsing.CFMLSource in project CFLint by cflint.
the class TestCFMLParse method test.
@Test
public void test() {
final CFMLSource cfmlSource = new CFMLSource("<cfcomponent><cfset/></cfcomponent>");
System.out.println(cfmlSource.getAllCFMLTags());
System.out.println(cfmlSource.getAllElements());
System.out.println(cfmlSource.getChildElements());
}
use of cfml.parsing.CFMLSource in project CFLint by cflint.
the class CFLint method process.
public void process(final String src, final String filename) throws ParseException, IOException {
fireStartedProcessing(filename);
final CFMLSource cfmlSource = new CFMLSource(src != null && src.contains("<!---") ? CommentReformatting.wrap(src) : src);
final ParserTag firstTag = getFirstTagQuietly(cfmlSource);
final List<Element> elements = new ArrayList<Element>();
if (firstTag != null) {
elements.addAll(cfmlSource.getChildElements());
}
if (src.contains("component") && (elements.isEmpty() || elements.get(0).getBegin() > src.indexOf("component"))) {
// Check if pure cfscript
final CFScriptStatement scriptStatement = cfmlParser.parseScript(src);
Context context = new Context(filename, null, null, false, handler, scriptStatement.getTokens());
process(scriptStatement, context);
} else {
processStack(elements, " ", filename, null);
}
fireFinishedProcessing(filename);
}
Aggregations