OxL Reference

error prefix-literal

error Standard: [§15.3]

What it means#

A prefixed literal p"..." calls the comptime literal fn p in scope (§1.5, §15.3). When the handler returns a CompileError, for example a malformed regular expression or an unknown time zone, the error is placed at the literal. The text is passed verbatim, without escapes (D-003).

Example#

oxl✓ checked in CI
fn main() {
  let r = re"(unclosed"      // <- prefix-literal
}
error
prefix-literal

How to fix#

oxl✓ checked in CI
fn main() {
  let r = re"\(unclosed"
}

Make the literal valid for its handler. Check the handler's documentation for the accepted syntax.

See also#

OxL 1.0.0-beta · Documentation version 1.0.0-beta© OxwaldLink · generated from the Standard, the std sources and the guides