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>)
| 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 |
| 199 | fn 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 |
| 209 | fn parse_case(rule: Pair<Rule>) -> ExprCase { |