Liking cljdoc? Tell your friends :D

hive-system.pattern.construct.regal

COLLECT layer: an anti-corruption layer over lambdaisland/regal, and the three dialect profiles it can render.

Regal is the emitter we buy rather than build — it owns escaping, precedence and grouping, and it is the only code here that knows what a regex looks like. Its vocabulary does not cross into the domain: it throws, we return a Result; it names flavors, we name dialects.

What regal does not do, and this layer must

Measured on 0.1.175: regal does NOT gate on flavor. [:atomic "ab"] renders as (?>ab) under :ecma, where JavaScript has no atomic groups, and an unknown flavor is accepted silently. The capability gate in construct.dialect is therefore load-bearing, not ceremony.

Dialects shipped

:java every capability flavor :java9 :ecma no atomic groups flavor :ecma :re2 no lookaround, no atomic flavor :ecma (rg, sd, RE2, Rust regex)

:posix-ere is deliberately absent: ERE has no non-capturing group, so regal's (?:…) output is not ERE even after a capability gate. It needs a real second emitter, which this design declines to build.

COLLECT layer: an anti-corruption layer over lambdaisland/regal, and the
three dialect profiles it can render.

Regal is the emitter we buy rather than build — it owns escaping, precedence
and grouping, and it is the only code here that knows what a regex looks
like. Its vocabulary does not cross into the domain: it throws, we return a
Result; it names flavors, we name dialects.

## What regal does not do, and this layer must

Measured on 0.1.175: regal does NOT gate on flavor. `[:atomic "ab"]` renders
as `(?>ab)` under `:ecma`, where JavaScript has no atomic groups, and an
unknown flavor is accepted silently. The capability gate in
`construct.dialect` is therefore load-bearing, not ceremony.

## Dialects shipped

  :java  every capability            flavor :java9
  :ecma  no atomic groups            flavor :ecma
  :re2   no lookaround, no atomic    flavor :ecma  (rg, sd, RE2, Rust regex)

`:posix-ere` is deliberately absent: ERE has no non-capturing group, so
regal's `(?:…)` output is not ERE even after a capability gate. It needs a
real second emitter, which this design declines to build.
raw docstring

built-inclj

Every profile this namespace ships.

Every profile this namespace ships.
sourceraw docstring

ecmaclj

JavaScript / ECMAScript. No atomic groups.

JavaScript / ECMAScript. No atomic groups.
sourceraw docstring

javaclj

The JVM's own engine: java.util.regex.

The JVM's own engine: `java.util.regex`.
sourceraw docstring

make-emitterclj

(make-emitter profile)

An emitter rendering through regal for PROFILE.

An emitter rendering through regal for PROFILE.
sourceraw docstring

re2clj

RE2 and Rust's regex crate — what rg and sd run. Linear-time by construction, which is exactly why it has no lookaround and no backrefs.

RE2 and Rust's regex crate — what `rg` and `sd` run. Linear-time by
construction, which is exactly why it has no lookaround and no backrefs.
sourceraw docstring

register-built-in!clj

(register-built-in!)

Register every built-in profile. Returns the vector of Results.

Register every built-in profile. Returns the vector of Results.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close