HS pick runtime: guard nil inputs so pick first/last/items/match/matches don't hang
- hs-pick-first/last/random/items/slice: short-circuit nil or non-list (strings flow through unchanged). - New hs-pick-match / hs-pick-matches wrappers around regex-match / regex-find-all, also nil-safe; compiler routes pick-match / pick-matches through them. Unblocks 'pick first from null returns null' and 'pick match from null returns null' which previously looped past step_limit.
This commit is contained in:
@@ -818,7 +818,7 @@
|
||||
(quote set!)
|
||||
(quote it)
|
||||
(list
|
||||
(quote regex-match)
|
||||
(quote hs-pick-match)
|
||||
(hs-to-sx (nth ast 1))
|
||||
(hs-to-sx (nth ast 2)))))
|
||||
((= head (quote pick-matches))
|
||||
@@ -826,7 +826,7 @@
|
||||
(quote set!)
|
||||
(quote it)
|
||||
(list
|
||||
(quote regex-find-all)
|
||||
(quote hs-pick-matches)
|
||||
(hs-to-sx (nth ast 1))
|
||||
(hs-to-sx (nth ast 2)))))
|
||||
((= head (quote prop-is))
|
||||
|
||||
Reference in New Issue
Block a user