MCPcopy Create free account
hub / github.com/aiscriptdev/aiscript / block

Method block

aiscript-vm/src/parser/mod.rs:1226–1237  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

1224 }
1225
1226 fn block(&mut self) -> Vec<Stmt<'gc>> {
1227 let mut statements = Vec::new();
1228
1229 while !self.check(TokenType::CloseBrace) && !self.is_at_end() {
1230 if let Some(declaration) = self.declaration() {
1231 statements.push(declaration);
1232 }
1233 }
1234
1235 self.consume(TokenType::CloseBrace, "Expect '}' after block.");
1236 statements
1237 }
1238
1239 // Parse block expression. The different between block_expr() and block() are:
1240 // - block_expr() will treat the last line as an expression if it not ends with semicolon.

Callers 1

block_statementMethod · 0.80

Calls 5

checkMethod · 0.80
is_at_endMethod · 0.80
declarationMethod · 0.80
pushMethod · 0.80
consumeMethod · 0.45

Tested by

no test coverage detected