Undo regex type rename

Unnecessary breaking change for now
This commit is contained in:
Laurenz 2023-06-09 15:52:31 +02:00
parent ad41482b70
commit c65aaa9137
3 changed files with 9 additions and 4 deletions

View File

@ -567,7 +567,7 @@ impl Hash for Regex {
} }
cast! { cast! {
type Regex: "regex", type Regex: "regular expression",
} }
/// A pattern which can be searched for in a string. /// A pattern which can be searched for in a string.

View File

@ -241,7 +241,7 @@ impl Reflect for ShowableSelector {
CastInfo::Type("function"), CastInfo::Type("function"),
CastInfo::Type("label"), CastInfo::Type("label"),
CastInfo::Type("string"), CastInfo::Type("string"),
CastInfo::Type("regex"), CastInfo::Type("regular expression"),
CastInfo::Type("symbol"), CastInfo::Type("symbol"),
CastInfo::Type("selector"), CastInfo::Type("selector"),
]) ])
@ -250,7 +250,12 @@ impl Reflect for ShowableSelector {
fn castable(value: &Value) -> bool { fn castable(value: &Value) -> bool {
matches!( matches!(
value.type_name(), value.type_name(),
"symbol" | "string" | "label" | "function" | "regex" | "selector" "symbol"
| "string"
| "label"
| "function"
| "regular expression"
| "selector"
) )
} }
} }

View File

@ -96,7 +96,7 @@ Hey
= Heading = 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: [] #show red: []
--- ---