mirror of
https://github.com/janet-lang/janet
synced 2025-10-16 08:17:41 +00:00
Add ability to Janet signal from C functions.
While C functions are not re-entrant, signaling from a C function can be used to implement async returns. When resuming a fiber that signalled from within a C function, the fiber is started after the instruction that emitted the signal. The resume argument is used as the return result from the c function.
This commit is contained in:
@@ -203,12 +203,12 @@
|
||||
(defn check-match
|
||||
[pat text should-match]
|
||||
(def result (peg/match pat text))
|
||||
(assert (= (not should-match) (not result)) text))
|
||||
(assert (= (not should-match) (not result)) (string "check-match " text)))
|
||||
|
||||
(defn check-deep
|
||||
[pat text what]
|
||||
(def result (peg/match pat text))
|
||||
(assert (deep= result what) text))
|
||||
(assert (deep= result what) (string "check-deep " text)))
|
||||
|
||||
# Just numbers
|
||||
|
||||
|
Reference in New Issue
Block a user