From 028632a3a10202ee21eaaf7ecf13ca7fe331106e Mon Sep 17 00:00:00 2001 From: Laurenz Date: Fri, 17 Feb 2023 16:32:48 +0100 Subject: Fix error handling after hashtag --- src/model/func.rs | 10 +++++----- src/model/value.rs | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/model') diff --git a/src/model/func.rs b/src/model/func.rs index c5bab64c..9583f6fd 100644 --- a/src/model/func.rs +++ b/src/model/func.rs @@ -517,16 +517,16 @@ mod tests { fn test_captures() { // Let binding and function definition. test("#let x = x", &["x"]); - test("#let x; #{x + y}", &["y"]); + test("#let x; #(x + y)", &["y"]); test("#let f(x, y) = x + y", &[]); test("#let f(x, y) = f", &[]); test("#let f = (x, y) => f", &["f"]); // Closure with different kinds of params. - test("#{(x, y) => x + z}", &["z"]); - test("#{(x: y, z) => x + z}", &["y"]); - test("#{(..x) => x + y}", &["y"]); - test("#{(x, y: x + z) => x + y}", &["x", "z"]); + test("#((x, y) => x + z)", &["z"]); + test("#((x: y, z) => x + z)", &["y"]); + test("#((..x) => x + y)", &["y"]); + test("#((x, y: x + z) => x + y)", &["x", "z"]); test("#{x => x; x}", &["x"]); // Show rule. diff --git a/src/model/value.rs b/src/model/value.rs index b860a3f6..dff27fde 100644 --- a/src/model/value.rs +++ b/src/model/value.rs @@ -133,7 +133,7 @@ impl Value { format_str!("{:?}", self) } - /// Attach a span to the value, if possibly. + /// Attach a span to the value, if possible. pub fn spanned(self, span: Span) -> Self { match self { Value::Content(v) => Value::Content(v.spanned(span)), -- cgit v1.2.3