HS: contains/matches ignoring case support — 425→426

- Parser: contains/matches with ignoring case modifier
- Compiler: contains-ignore-case? → hs-contains-ignore-case?
- Compiler: matches-ignore-case? → hs-matches-ignore-case?
- Runtime: downcase-based case-insensitive contains/matches

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-13 09:45:57 +00:00
parent c05d8788c7
commit 4cac08d56f
7 changed files with 72 additions and 20 deletions

View File

@@ -520,9 +520,27 @@
(match-kw "with")
(list (quote ends-with?) left (parse-expr))))
((and (= typ "keyword") (= val "matches"))
(do (adv!) (list (quote matches?) left (parse-expr))))
(do
(adv!)
(let
((right (parse-expr)))
(if
(match-kw "ignoring")
(do
(match-kw "case")
(list (quote matches-ignore-case?) left right))
(list (quote matches?) left right)))))
((and (= typ "keyword") (= val "contains"))
(do (adv!) (list (quote contains?) left (parse-expr))))
(do
(adv!)
(let
((right (parse-expr)))
(if
(match-kw "ignoring")
(do
(match-kw "case")
(list (quote contains-ignore-case?) left right))
(list (quote contains?) left right)))))
((and (= typ "keyword") (= val "as"))
(do
(adv!)