use of com.perl5.lang.perl.lexer.adapters.PerlMergingLexerAdapter in project Perl5-IDEA by Camelcade.
the class PerlLexerPerformanceTest method testLexing.
private long testLexing(String testData) {
PerlMergingLexerAdapter perlLexer = new PerlMergingLexerAdapter(getProject(), false, true);
perlLexer.start(testData, 0, testData.length(), 0);
long start = System.currentTimeMillis();
int tokens = 0;
while (perlLexer.getTokenType() != null) {
perlLexer.advance();
tokens++;
}
return System.currentTimeMillis() - start;
}
use of com.perl5.lang.perl.lexer.adapters.PerlMergingLexerAdapter in project Perl5-IDEA by Camelcade.
the class TemplateToolkitPerlCodeElementType method doParseContents.
@Override
protected ASTNode doParseContents(@NotNull ASTNode chameleon, @NotNull PsiElement psi) {
Project project = psi.getProject();
PsiBuilder builder = PsiBuilderFactory.getInstance().createBuilder(project, chameleon, new PerlMergingLexerAdapter(project), PerlLanguage.INSTANCE, chameleon.getText());
PsiParser parser = PerlParserImpl.INSTANCE;
return parser.parse(this, builder).getFirstChildNode();
}
Aggregations