From b89cd128ae118571efe8a5a5b40b9365e3007746 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Tue, 29 Jun 2021 13:08:16 +0200 Subject: Wide calls --- src/syntax/expr.rs | 4 +++- src/syntax/token.rs | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'src/syntax') diff --git a/src/syntax/expr.rs b/src/syntax/expr.rs index 62f02399..aabff1ea 100644 --- a/src/syntax/expr.rs +++ b/src/syntax/expr.rs @@ -295,7 +295,7 @@ impl BinOp { Token::And => Self::And, Token::Or => Self::Or, Token::EqEq => Self::Eq, - Token::BangEq => Self::Neq, + Token::ExclEq => Self::Neq, Token::Lt => Self::Lt, Token::LtEq => Self::Leq, Token::Gt => Self::Gt, @@ -388,6 +388,8 @@ pub struct CallExpr { pub span: Span, /// The function to call. pub callee: Box, + /// Whether the call is wide, that is, capturing the template behind it. + pub wide: bool, /// The arguments to the function. pub args: CallArgs, } diff --git a/src/syntax/token.rs b/src/syntax/token.rs index 3f07bb33..25062264 100644 --- a/src/syntax/token.rs +++ b/src/syntax/token.rs @@ -42,12 +42,14 @@ pub enum Token<'s> { Hyph, /// A slash: `/`. Slash, + /// An exlamation mark. + Excl, /// A single equals sign: `=`. Eq, /// Two equals signs: `==`. EqEq, /// An exclamation mark followed by an equals sign: `!=`. - BangEq, + ExclEq, /// A less-than sign: `<`. Lt, /// A less-than sign followed by an equals sign: `<=`. @@ -227,9 +229,10 @@ impl<'s> Token<'s> { Self::Plus => "plus", Self::Hyph => "minus", Self::Slash => "slash", + Self::Excl => "exclamation mark", Self::Eq => "assignment operator", Self::EqEq => "equality operator", - Self::BangEq => "inequality operator", + Self::ExclEq => "inequality operator", Self::Lt => "less-than operator", Self::LtEq => "less-than or equal operator", Self::Gt => "greater-than operator", -- cgit v1.2.3