MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / parse_program

Method parse_program

crates/hll-to-ir/src/parser.rs:70–92  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

68 // Span-less constructor used only by parser/compiler unit tests; the real
69 // pipeline always carries source spans via `new_with_spans`.
70 #[cfg(test)]
71 pub fn new(tokens: Vec<Token<'a>>) -> Self {
72 let spans = vec![Span::default(); tokens.len()];
73 Self {
74 tokens,
75 spans,
76 pos: 0,
77 pending_gt_from_shr: false,
78 type_names: std::collections::HashSet::new(),
79 enum_names: prelude_enum_names(),
80 synthesized_declarations: Vec::new(),
81 next_lambda_id: 0,
82 }
83 }
84
85 pub fn new_with_spans(token_spans: Vec<(Token<'a>, Span)>) -> Self {
86 let (tokens, spans): (Vec<_>, Vec<_>) = token_spans.into_iter().unzip();
87 Self {
88 tokens,
89 spans,
90 pos: 0,
91 pending_gt_from_shr: false,
92 type_names: std::collections::HashSet::new(),
93 enum_names: prelude_enum_names(),
94 synthesized_declarations: Vec::new(),
95 next_lambda_id: 0,

Calls 7

consume_terminatorsMethod · 0.80
is_eofMethod · 0.80
parse_impl_blockMethod · 0.80
is_declaration_startMethod · 0.80
pushMethod · 0.80
parse_declarationMethod · 0.80
parse_statementMethod · 0.80