From ba3d43f7b2a18984be27f3d472884a19f3adce4c Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sun, 27 Dec 2020 20:45:20 +0100 Subject: Refresh function call and dictionary syntax - No colon between function name and arguments, just whitespace - "Named" arguments (previously "keyword" arguments) use colon instead of equals sign --- src/parse/parser.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/parse/parser.rs') diff --git a/src/parse/parser.rs b/src/parse/parser.rs index a8e5883a..d23aec3f 100644 --- a/src/parse/parser.rs +++ b/src/parse/parser.rs @@ -40,24 +40,24 @@ impl<'s> Parser<'s> { /// Eat the next token and add a diagnostic that it is not the expected /// `thing`. - pub fn diag_expected(&mut self, thing: &str) { + pub fn diag_expected(&mut self, what: &str) { let before = self.pos(); if let Some(found) = self.eat() { let after = self.pos(); self.diag(error!( before .. after, "expected {}, found {}", - thing, + what, found.name(), )); } else { - self.diag_expected_at(thing, self.pos()); + self.diag_expected_at(what, self.pos()); } } /// Add a diagnostic that the `thing` was expected at the given position. - pub fn diag_expected_at(&mut self, thing: &str, pos: Pos) { - self.diag(error!(pos, "expected {}", thing)); + pub fn diag_expected_at(&mut self, what: &str, pos: Pos) { + self.diag(error!(pos, "expected {}", what)); } /// Eat the next token and add a diagnostic that it is unexpected. @@ -220,7 +220,7 @@ impl<'s> Parser<'s> { Token::RightParen => Group::Paren, Token::RightBracket => Group::Bracket, Token::RightBrace => Group::Brace, - Token::Chain => Group::Subheader, + Token::Pipe => Group::Subheader, _ => return Some(token), }; -- cgit v1.2.3