parsers.kotlin
Kotlin regex-based parser. Extracts classes, interfaces, objects, data classes, and functions from Kotlin source files.
Contents
Classes
class
class KotlinParser(BaseParser)
Regex-based parser for Kotlin source files.
Methods
def
def parse_file(self, filepath: str | Path) -> ModuleDoc | None
Parse a file and extract its documentation.
Args:
filepath: The path to the file to parse, as a string or a Path object.
Returns:
A ModuleDoc object representing the parsed file, or None if the file does not exist or cannot be read.
Raises:
None
def
def _extract_methods(self, source: str, body_start: int) -> list[FunctionDoc]
Functions
def
def _extract_brace_body(source: str, start: int) -> str
def
def _build_kdoc_map(source: str) -> dict[int, str]
def
def _clean_kdoc(raw: str) -> str
def
def _parse_kotlin_params(raw: str) -> list[ArgInfo]