reject nulls in match inputs entirely
This commit is contained in:
parent
7e674f0ad7
commit
9e936277c7
2 changed files with 9 additions and 3 deletions
10
spl/std.spl
10
spl/std.spl
|
@ -648,7 +648,10 @@ func times { | with amount callable ;
|
|||
}
|
||||
|
||||
func check-match { bool | with input output ;
|
||||
output gettype "func" eq input null eq not and if {
|
||||
input null eq if {
|
||||
0 2 stop
|
||||
}
|
||||
output gettype "func" eq if {
|
||||
1 2 stop
|
||||
}
|
||||
input output eq if {
|
||||
|
@ -686,7 +689,10 @@ func match-unchecked { | with input output ;
|
|||
}
|
||||
|
||||
func match { bool | with input output ;
|
||||
output gettype "func" eq input null eq not and if {
|
||||
input null eq if {
|
||||
0 2 stop
|
||||
}
|
||||
output gettype "func" eq if {
|
||||
input output call
|
||||
1 2 stop
|
||||
}
|
||||
|
|
|
@ -138,7 +138,7 @@ fn read_block_dyn(
|
|||
run_as_base: false,
|
||||
}))))
|
||||
}
|
||||
x if x.len() >= 2 && &x[0..2] == "!{" => {
|
||||
x if x.len() >= 2 && x.get(0..2) == Some("!{") => {
|
||||
words.push(Word::Const(Value::Str(x[2..].to_owned())));
|
||||
}
|
||||
"<" => {
|
||||
|
|
Loading…
Add table
Reference in a new issue