MCPcopy Create free account
hub / github.com/ControlCplusControlV/Scribe / parse_identifier_list

Function parse_identifier_list

crates/papyrus/src/parser.rs:199–206  ·  view source on GitHub ↗

Parses an identifier list for function definitions or variable declarations. TODO: explain how this gets handled in transpilation, variables stored in a hashmap during translation

(rule: Pair<Rule>)

Source from the content-addressed store, hash-verified

197//Parses an identifier list for function definitions or variable declarations.
198//TODO: explain how this gets handled in transpilation, variables stored in a hashmap during translation
199fn parse_identifier_list(rule: Pair<Rule>) -> Vec<Identifier> {
200 let mut identifiers = Vec::new();
201 for rule in rule.into_inner() {
202 let identifier = rule.as_str();
203 identifiers.push(identifier.to_string());
204 }
205 identifiers
206}
207
208//Parses a case statement into an Expr
209fn parse_case(rule: Pair<Rule>) -> ExprCase {

Callers 1

parse_statementFunction · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected