Skip to content

Commit

Permalink
parse params using list_identity
Browse files Browse the repository at this point in the history
  • Loading branch information
NTTVy03 committed Dec 8, 2024
1 parent cd125ab commit 15470b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
7 changes: 1 addition & 6 deletions crates/parser/src/grammar/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@ pub fn function_parse(p: &mut Parser) {

p.expect(LParen);
let arg_marker = p.open();
while !p.at(RParen) && !p.eof() {
p.expect(Identifier);
if p.at(Comma) {
p.expect(Comma);
}
}
list_identity::parse(p);
p.close(arg_marker, ParameterList);
p.expect(RParen);

Expand Down
12 changes: 5 additions & 7 deletions crates/parser/src/grammar/template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,21 @@ use crate::grammar::*;
pub fn template(p: &mut Parser) {
// assert!(p.at(TemplateKw));
let m = p.open();

p.expect(TemplateKw);

let name_marker = p.open();
p.expect(Identifier);
p.close(name_marker, TemplateName);

p.expect(LParen);
let arg_marker = p.open();
while !p.at(RParen) && !p.eof() {
p.expect(Identifier);
if p.at(Comma) {
p.expect(Comma);
}
}

list_identity::parse(p);
p.close(arg_marker, ParameterList);
p.expect(RParen);

block::block(p);

p.close(m, TemplateDef);
}

Expand Down

0 comments on commit 15470b1

Please sign in to comment.