MCPcopy Create free account
hub / github.com/aspizu/goboscript / parse_undef

Method parse_undef

src/pre_processor.rs:323–334  ·  view source on GitHub ↗
(&mut self, span: &mut Span)

Source from the content-addressed store, hash-verified

321 }
322
323 fn parse_undef(&mut self, span: &mut Span) -> Result<bool, Diagnostic> {
324 if get_token(&self.tokens[*self.i]) != &Token::Undef {
325 return Ok(false);
326 }
327 self.remove_token(span);
328 self.expect_no_eof()?;
329 let name = get_token(&self.tokens[*self.i]).clone();
330 self.simple_defines.remove(name.to_string().as_str());
331 self.function_defines.remove(name.to_string().as_str());
332 self.remove_token(span);
333 Ok(true)
334 }
335
336 fn substitute_concat(&mut self, span: &mut Span) -> Result<bool, Diagnostic> {
337 let Token::Name(macro_name) = get_token(&self.tokens[*self.i]) else {

Callers 1

processMethod · 0.80

Calls 4

get_tokenFunction · 0.85
remove_tokenMethod · 0.80
expect_no_eofMethod · 0.80
to_stringMethod · 0.45

Tested by

no test coverage detected