mirror of
https://github.com/janet-lang/janet
synced 2025-11-26 20:15:14 +00:00
For #293, correct wildcards in dictinoaries.
This commit is contained in:
@@ -1368,9 +1368,11 @@
|
||||
~(if (,dictionary? ,$dict)
|
||||
,((fn aux []
|
||||
(set key (next pattern key))
|
||||
(def $val (gensym))
|
||||
(if (= key nil)
|
||||
(onmatch)
|
||||
(match-1 [(in pattern key) [not= (in pattern key) nil]] [in $dict key] aux seen))))
|
||||
~(do (def ,$val (,get ,$dict ,key))
|
||||
,(match-1 [(in pattern key) [not= nil $val]] $val aux seen)))))
|
||||
,sentinel)))
|
||||
|
||||
:else ~(if (= ,pattern ,expr) ,(onmatch) ,sentinel)))
|
||||
|
||||
Reference in New Issue
Block a user