MCPcopy Index your code
hub / github.com/endbasic/endbasic / parse_sub

Method parse_sub

core/src/parser.rs:1526–1530  ·  view source on GitHub ↗

Parses a `SUB` definition.

(&mut self, sub_pos: LineCol)

Source from the content-addressed store, hash-verified

1524
1525 /// Parses a `SUB` definition.
1526 fn parse_sub(&mut self, sub_pos: LineCol) -> Result<Statement> {
1527 let (name, name_pos, params) = self.parse_callable_signature(false, false)?;
1528 let (body, end_pos) = self.parse_callable_body(sub_pos, Token::Sub)?;
1529 Ok(Statement::Callable(CallableSpan { name, name_pos, params, body, end_pos }))
1530 }
1531
1532 /// Advances until the next statement after failing to parse a `FUNCTION` or `SUB` definition.
1533 fn reset_callable(&mut self, exp_token: Token) -> Result<()> {

Callers 1

parse_oneMethod · 0.80

Calls 3

CallableInterface · 0.85
parse_callable_bodyMethod · 0.80

Tested by

no test coverage detected