summaryrefslogtreecommitdiff
path: root/src/parse/parser.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2020-12-27 20:45:20 +0100
committerLaurenz <laurmaedje@gmail.com>2020-12-27 20:45:20 +0100
commitba3d43f7b2a18984be27f3d472884a19f3adce4c (patch)
tree1c6ffa31145fb69c19319440969d2037b27b584f /src/parse/parser.rs
parent750d220bb080be077cd7ede6d18d485b1c3fb0c9 (diff)
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
Diffstat (limited to 'src/parse/parser.rs')
-rw-r--r--src/parse/parser.rs12
1 files changed, 6 insertions, 6 deletions
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),
};