regex::compile checks a known pattern while building (on regex::Dynamic at first)Open and answer this issue on GitHub.
ready · opened 2026-11-21 · updated 2026-11-21 · 0 comments
Part of #673 Needs #906
regex::compile(comptime p) takes a pattern known while building, checks it there and gives a compiled regex (ADR-regex-1 D3, D4). This is step 3 of #673, on the floor engine only: at first it gives Regex[regex::Dynamic]. It needs ADR-333 D3 (a comptime parameter of a function) and ADR-specialization-1 D7 (a result type computed from it), which are built under #906.
regex::compile(comptime p) gives Regex[regex::Dynamic] and checks the pattern while building (NK1244, the engine’s message). Tests in tests/compiler/tests/: a good pattern that matches at run time, and a bad one whose .stderr shows NK1244 with the engine’s message.regex::compile with a run-time value is refused, the help naming regex::dynamic. Test: a .nika with its .stderr.regex::compile("…") with a known pattern runs on regex::Dynamic, a bad known pattern is refused while building with NK1244 and the engine’s message, and a run-time argument is refused with a help naming regex::dynamic; the commit of item 2 says Fixes #N.
Split from #673 by Claude Code