matching now even less awkward
This commit is contained in:
parent
c3e2dbc1b8
commit
24f32fb4cb
2 changed files with 15 additions and 0 deletions
|
@ -716,6 +716,12 @@ func _'match-else-error { |
|
|||
}
|
||||
}
|
||||
|
||||
func _'match-else-push { |
|
||||
if {
|
||||
pop
|
||||
}
|
||||
}
|
||||
|
||||
def _'has-been-called 0 =_'has-been-called
|
||||
func _ { |
|
||||
_'has-been-called not if {
|
||||
|
|
|
@ -260,6 +260,12 @@ fn read_block_dyn(
|
|||
"=" => {
|
||||
if str_words[i + 1] == ">" {
|
||||
i += 1;
|
||||
let pushing = if str_words[i + 1] == "?" {
|
||||
i += 1;
|
||||
true
|
||||
} else {
|
||||
false
|
||||
};
|
||||
let throwing = if str_words[i + 1] == "!" {
|
||||
i += 1;
|
||||
true
|
||||
|
@ -291,6 +297,9 @@ fn read_block_dyn(
|
|||
if throwing {
|
||||
words.push(Word::Call("_'match-else-error".to_owned(), false, 0));
|
||||
}
|
||||
if pushing {
|
||||
words.push(Word::Call("_'match-else-push".to_owned(), false, 0));
|
||||
}
|
||||
} else {
|
||||
words.push(Word::Call("=".to_owned(), false, 0));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue