Expand description
Port of the Kotlin compiler’s PSI parser (KotlinParsing, KotlinExpressionParsing,
KDocParser) on top of a re-implementation of IntelliJ’s PsiBuilder semantics.
See builder for the builder contract and parsing for the porting conventions.
Re-exports§
pub use builder::ChameleonCache;
Modules§
- builder
- Re-implementation of IntelliJ’s
PsiBuilderImpl(platform 251.27812.49, the one bundled with Kotlin 2.4.20) and the Kotlin builder wrappers on top of it. - kt_
tokens - Token sets and token-class predicates from
KtTokens.java(psi-api/…/lexer/KtTokens.java). Individual token kinds live inSyntaxKindunder theirKtTokensfield names. - parsing
- Port of
org.jetbrains.kotlin.parsing(third_party/kotlin/compiler/psi/parser/src/…/parsing). - token_
set - IntelliJ
TokenSet: an immutable, const-constructible bit set ofSyntaxKinds.
Enums§
Functions§
- parse_
block_ code_ fragment - parse_
block_ expression BlockExpressionElementType.parseContents: the reparse of a collapsedBLOCK.- parse_
expression_ code_ fragment - parse_
file - Parses a whole file.
textmust already have CRLF normalized to LF. - parse_
file_ cached parse_filefor callers re-parsing similar text: the result is identical, but lazy blocks, lambdas and KDoc whose text was already seen withcacheare reused instead of re-parsed.- parse_
lambda_ expression LambdaExpressionElementType.parseContents: the reparse of a collapsedLAMBDA_EXPRESSION.- parse_
type_ code_ fragment