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

Method process

src/pre_processor.rs:58–92  ·  view source on GitHub ↗
(
        &mut self,
        span: &mut Span,
        suppress: &FxHashSet<SmolStr>,
    )

Source from the content-addressed store, hash-verified

56 }
57
58 fn process(
59 &mut self,
60 span: &mut Span,
61 suppress: &FxHashSet<SmolStr>,
62 ) -> Result<(), Diagnostic> {
63 let mut dirty = false;
64 *self.i = span.start;
65 while *self.i < span.end {
66 if let Some(define_name) = self.parse_define_begin(span)? {
67 if self.parse_function_define(span, define_name.clone())? {
68 continue;
69 }
70 self.parse_simple_define(span, define_name)?;
71 continue;
72 }
73 if self.parse_undef(span)? {
74 continue;
75 }
76 if self.substitute_simple_define(span, suppress)? {
77 continue;
78 }
79 if self.substitute_function_define(span, suppress)? {
80 continue;
81 }
82 if self.substitute_concat(span)? {
83 dirty = true;
84 continue;
85 }
86 *self.i += 1;
87 }
88 if dirty {
89 self.process(span, suppress)?;
90 }
91 Ok(())
92 }
93
94 fn remove_marker_tokens(&mut self) {
95 self.tokens.retain(|token| {

Callers 3

applyMethod · 0.80

Calls 7

parse_define_beginMethod · 0.80
parse_function_defineMethod · 0.80
parse_simple_defineMethod · 0.80
parse_undefMethod · 0.80
substitute_concatMethod · 0.80

Tested by

no test coverage detected