use of com.jetbrains.python.parsing.ParsingContext in project intellij-community by JetBrains.
the class PyConsoleParser method parse.
@NotNull
@Override
public ASTNode parse(IElementType root, PsiBuilder builder) {
final PsiBuilder.Marker rootMarker = builder.mark();
myIPythonStartSymbol = myPythonConsoleData.isIPythonEnabled() && startsWithIPythonSpecialSymbol(builder);
ParsingContext context = createParsingContext(builder, myLanguageLevel, myFutureFlag);
StatementParsing stmt_parser = context.getStatementParser();
// must be done before touching the caching lexer with eof() call.
builder.setTokenTypeRemapper(stmt_parser);
while (!builder.eof()) {
stmt_parser.parseStatement();
}
rootMarker.done(root);
return builder.getTreeBuilt();
}
use of com.jetbrains.python.parsing.ParsingContext in project intellij-community by JetBrains.
the class IpnbPyParser method parse.
@NotNull
@Override
public ASTNode parse(IElementType root, PsiBuilder builder) {
final PsiBuilder.Marker rootMarker = builder.mark();
myIPythonStartSymbol = PyConsoleParser.startsWithIPythonSpecialSymbol(builder);
ParsingContext context = createParsingContext(builder, myLanguageLevel, null);
StatementParsing statementParser = context.getStatementParser();
builder.setTokenTypeRemapper(statementParser);
while (!builder.eof()) {
statementParser.parseStatement();
}
rootMarker.done(root);
return builder.getTreeBuilt();
}
Aggregations