Change the string/first
instruction
This changes the `string/first` instruction to return :ignore-instruction if the string is empty.
This commit is contained in:
parent
2008712e0a
commit
39a25fa7e3
@ -68,7 +68,9 @@
|
|||||||
:string_first
|
:string_first
|
||||||
^{:stacks #{:char :string}}
|
^{:stacks #{:char :string}}
|
||||||
(fn [state]
|
(fn [state]
|
||||||
(make-instruction state first [:string] :char)))
|
(make-instruction state
|
||||||
|
#(if (empty? %) :ignore-instruction (first %))
|
||||||
|
[:string] :char)))
|
||||||
|
|
||||||
;; Pushes the STRING version of the top BOOLEAN, e.g. "true"
|
;; Pushes the STRING version of the top BOOLEAN, e.g. "true"
|
||||||
(def-instruction
|
(def-instruction
|
||||||
|
Loading…
x
Reference in New Issue
Block a user