MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / parse_block

Method parse_block

crates/hll-to-ir/src/parser.rs:203–215  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

201 let ty = self.parse_type()?;
202 DeclNode::Variable {
203 name,
204 ty,
205 init: None,
206 is_extern: true,
207 }
208 }
209 }
210 Some(Token::Ident(_)) => {
211 // Look ahead to determine if this is a function or variable declaration
212 if self.peek_n(1) == Some(&Token::ColonEqual) {
213 // `alias := import("path")` is a module binding, not an ordinary
214 // inferred variable; its RHS is the `import(...)` builtin.
215 if self.peek_n(2) == Some(&Token::Import) {
216 let alias = self.expect_ident()?;
217 self.expect_colon_equal()?;
218 let path = self.parse_import_call()?;

Callers 6

parse_statementMethod · 0.80
parse_function_declMethod · 0.80
parse_if_statementMethod · 0.80
parse_while_statementMethod · 0.80
parse_for_statementMethod · 0.80

Calls 6

expect_lbraceMethod · 0.80
consume_terminatorsMethod · 0.80
check_rbraceMethod · 0.80
pushMethod · 0.80
parse_statementMethod · 0.80
expect_rbraceMethod · 0.80

Tested by

no test coverage detected