MoonBit-native Tree-sitter runtime and generator (work in progress)
pub(all) suberror ParseError {
NoLanguage
LanguageMismatch
Cancelled(ParseState)
InvalidInputCallback(byte_offset~ : UInt, point~ : Point, reason~ : String)
InvalidInputDecode(byte_offset~ : UInt, reason~ : String)
ScannerError(ScannerError)
LexError(byte_offset~ : UInt, state_id~ : StateId)
ParseTableError(state_id~ : StateId, symbol_id~ : SymbolId)
ParseStackUnderflow
} derive(Eq, Debug)type Inputfn Input::from_custom_callback(read : (UInt, Point) -> InputChunk, decode : (Bytes, Int) -> InputDecodeResult) -> Inputtype Languagetype Loggertype LookaheadIteratorfn LookaheadIterator::reset(self : LookaheadIterator, language : Language, state_id : StateId) -> Booltype Nodepub(all) struct ParseOptions {
cancellation_state : ParseState?
progress_callback : (ParseState) -> Bool?
}fn ParseOptions::with_progress(self : ParseOptions, callback : (ParseState) -> Bool) -> ParseOptionstype Parserfn Parser::parse(self : Parser, input : Input, old_tree? : Tree?, options? : ParseOptions) -> Tree raise ParseErrorfn Parser::parse_bytes(self : Parser, input : Bytes, old_tree? : Tree?, options? : ParseOptions) -> Tree raise ParseErrorfn Parser::parse_string(self : Parser, input : String, old_tree? : Tree?, options? : ParseOptions) -> Tree raise ParseErrorfn Parser::set_included_ranges(self : Parser, ranges : Array[Range]) -> Unit raise IncludedRangesErrortype Treetype TreeCursorfn TreeCursor::goto_first_child_for_byte_with_index(self : TreeCursor, byte : UInt) -> (Int, TreeCursor)?fn TreeCursor::goto_first_child_for_point_with_index(self : TreeCursor, point : Point) -> (Int, TreeCursor)?fn language_from_generated_tables(tables : GeneratedLanguageTables) -> Language raise TableValidationErrorInstall
Download zipMoonBit-native Tree-sitter runtime and generator (work in progress)