moonbit-community/treesitter/language does not have a README file
pub(all) struct Language {
abi_version : Int
symbol_count : Int
alias_count : Int
token_count : Int
external_token_count : Int
state_count : Int
large_state_count : Int
production_id_count : Int
field_count : Int
max_alias_sequence_length : Int
parse_table : Array[Int]
small_parse_table : Array[Int]
small_parse_table_map : Array[Int]
parse_actions : Array[ParseActionEntry]
symbol_names : Array[String]
field_names : Array[String]
field_map_slices : Array[MapSlice]
field_map_entries : Array[FieldMapEntry]
symbol_metadata : Array[SymbolMetadata]
public_symbol_map : Array[Int]
alias_map : Array[Int]
alias_sequences : Array[Int]
lex_modes : Array[LexMode]
lex_fn : LexProgram
keyword_lex_fn : LexProgram?
keyword_capture_token : Int
external_scanner : ExternalScannerData
primary_state_ids : Array[Int]
name : String
reserved_words : Array[Int]
max_reserved_word_set_size : Int
supertype_count : Int
supertype_symbols : Array[Int]
supertype_map_slices : Array[MapSlice]
supertype_map_entries : Array[Int]
metadata : LanguageMetadata
} derive(Eq, ToJson, Debug, FromJson)pub(all) struct LexCondition {
large_set : (Int, Bool)?
asserted : RangeCondition?
negated : RangeCondition?
} derive(Eq, ToJson, Debug, FromJson)pub(all) struct LexProgram {
states : Array[LexStateCode]
large_character_sets : Array[Array[CharacterRange]]
} derive(Eq, ToJson, Debug, FromJson)result = false // START_LEXER()
loop {
skip = false // start:
lookahead = lexer.lookahead
eof = lexer.eof() // eof = lexer->eof(lexer);
if state >= states.length() {
return false // default: return false;
}
code = states[state] // case state:
if code.accept_token is Some(symbol) { // ACCEPT_TOKEN(symbol)
result = true
lexer.result_symbol = symbol
lexer.mark_end()
}
if eof && code.eof_advance is Some(s) { // if (eof) ADVANCE(s);
next = s
} else if code.advance_map has a first (c, s) with c == lookahead {
next = s // ADVANCE_MAP(...)
} else if code.transitions has a first t whose condition holds {
next = t.state // if (...) ADVANCE/SKIP
skip = t.skip
} else {
return result // END_STATE()
}
state = next // goto next_state;
lexer.advance(skip) // next_state:
}pub(all) struct LexTransition {
condition : LexCondition
state : Int
skip : Bool
} derive(Eq, ToJson, Debug, FromJson)pub struct LookaheadIterator {
// private fields
}let compact_format_version : Int