From c65aaa9137aaefe37df7e87602a9ab25cb72c975 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Fri, 9 Jun 2023 15:52:31 +0200 Subject: [PATCH] Undo regex type rename Unnecessary breaking change for now --- src/eval/str.rs | 2 +- src/model/selector.rs | 9 +++++++-- tests/typ/compiler/show-node.typ | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/eval/str.rs b/src/eval/str.rs index 48ba83117..e3e83f3a7 100644 --- a/src/eval/str.rs +++ b/src/eval/str.rs @@ -567,7 +567,7 @@ impl Hash for Regex { } cast! { - type Regex: "regex", + type Regex: "regular expression", } /// A pattern which can be searched for in a string. diff --git a/src/model/selector.rs b/src/model/selector.rs index c1528c0a3..5a2b11cbc 100644 --- a/src/model/selector.rs +++ b/src/model/selector.rs @@ -241,7 +241,7 @@ impl Reflect for ShowableSelector { CastInfo::Type("function"), CastInfo::Type("label"), CastInfo::Type("string"), - CastInfo::Type("regex"), + CastInfo::Type("regular expression"), CastInfo::Type("symbol"), CastInfo::Type("selector"), ]) @@ -250,7 +250,12 @@ impl Reflect for ShowableSelector { fn castable(value: &Value) -> bool { matches!( value.type_name(), - "symbol" | "string" | "label" | "function" | "regex" | "selector" + "symbol" + | "string" + | "label" + | "function" + | "regular expression" + | "selector" ) } } diff --git a/tests/typ/compiler/show-node.typ b/tests/typ/compiler/show-node.typ index 2815dae85..27a4b6a9d 100644 --- a/tests/typ/compiler/show-node.typ +++ b/tests/typ/compiler/show-node.typ @@ -96,7 +96,7 @@ Hey = Heading --- -// Error: 7-10 expected function, label, string, regex, symbol, or selector, found color +// Error: 7-10 expected function, label, string, regular expression, symbol, or selector, found color #show red: [] ---