mirror of
https://github.com/janet-lang/janet
synced 2025-10-21 18:57:41 +00:00
Fix #861 - parser/produce caused state to be invalid for parser/state.
parser/produce was leaving a counter in the root state undecremented.
This commit is contained in:
@@ -199,4 +199,18 @@
|
||||
(def stream-env (dofile r))
|
||||
(assert (= (stream-env :x) 10) "dofile stream 1")
|
||||
|
||||
# Issue #861 - should be valgrind clean
|
||||
(def step1 "(a b c d)\n")
|
||||
(def step2 "(a b)\n")
|
||||
(def p1 (parser/new))
|
||||
(pp (parser/state p1))
|
||||
(parser/consume p1 step1)
|
||||
(loop [v :iterate (parser/produce p1)])
|
||||
(parser/state p1)
|
||||
(def p2 (parser/clone p1))
|
||||
(parser/state p2)
|
||||
(parser/consume p2 step2)
|
||||
(loop [v :iterate (parser/produce p2)])
|
||||
(parser/state p2)
|
||||
|
||||
(end-suite)
|
||||
|
Reference in New Issue
Block a user