MCPcopy Create free account
hub / github.com/AlenVelocity/MeowScript / parse_include_statement

Method parse_include_statement

src/parser.rs:113–127  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

111 }
112
113 pub fn parse_include_statement(&mut self) -> Option<Statement> {
114 self.next_token();
115 // the string next to the include keyword is the lib
116 let lib = match &self.current_token {
117 Token::String(ref s) => s.clone(),
118 _ => {
119 self.peek_error(Token::String(String::new()));
120 return None;
121 }
122 };
123 while !self.current_token(Token::Semicolon) {
124 self.next_token();
125 }
126 Some(Statement::Include(lib))
127 }
128
129 fn parse_block_statement(&mut self) -> BlockStatement {
130 self.next_token();

Callers 1

parse_statementMethod · 0.80

Calls 3

peek_errorMethod · 0.80
current_tokenMethod · 0.80
next_tokenMethod · 0.45

Tested by

no test coverage detected