MCPcopy Create free account
hub / github.com/LaBatata101/sith-language-server / parse_module

Method parse_module

crates/sith_python_parser/src/parser/mod.rs:127–139  ·  view source on GitHub ↗

Parses a Python module. This is to be used for [`Mode::Module`] and [`Mode::Ipython`].

(&mut self)

Source from the content-addressed store, hash-verified

125 ///
126 /// This is to be used for [`Mode::Module`] and [`Mode::Ipython`].
127 fn parse_module(&mut self) -> ModModule {
128 let body = self.parse_list_into_vec(
129 RecoveryContextKind::ModuleStatements,
130 Parser::parse_statement,
131 );
132
133 self.bump(TokenKind::EndOfFile);
134
135 ModModule {
136 body,
137 range: TextRange::new(self.start_offset, self.current_token_range().end()),
138 }
139 }
140
141 fn finish(self, syntax: Mod) -> Parsed<Mod> {
142 assert_eq!(

Callers 1

parseMethod · 0.80

Calls 4

parse_list_into_vecMethod · 0.80
current_token_rangeMethod · 0.80
bumpMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected