def finding

bolt@1.27.0.0 · src/rules/correctness/escape.bend:81

import bolt@1.27.0.0/src/rules/correctness/escape.bend as Escape
import Base
import bolt@1.27.0.0/src/finding.bend as F
import bolt@1.27.0.0/src/lazy/lazy.bend as Lazy

81# the finding for `\0` at a column, the digits after it in ds
82def finding(+ds: List<&2, Char>, +path: String, +line: U32, +col: U32) -> F.Finding:
83  +digits = String.from_list(ds)
84  Lazy.stop(F.Finding, List.is_empty(&2, Char, ds),
85    F.Finding{path, line, col, 3, "escape",
86      "\\0 followed by digits is a NUL character and then those digits, not an octal escape; write \\u{..} instead."},
87    _u => F.Finding{path, line, col, (U32.from_nat(String.length(digits)) + 2 : U32), "escape",
88      "\\0" ++ digits ++ " is a NUL character followed by \"" ++ digits ++ "\", not an octal escape; write \\u{" ++ hex(value(ds, 0)) ++ "}."})

Uses (14)

Used by (1)