def Scan.in_code

bend-lint-rules@0.2.0.0 · lib/linter/directives.bend:96

import bend-lint-rules@0.2.0.0/lib/linter/directives.bend as Directives
import Base

96def Scan.in_code(
97  glyph: Glyph,
98  +at: U32,
99  +line: U32,
100  +code: Bool,
101  open: Comment,
102  comments: List<&2, Comment>,
103  lines: List<&2, Bool>
104) -> Scan:
105  match glyph:
106    case LineEnd{}:
107      Scan{InCode{}, (at + 1: U32), (line + 1: U32), False{}, open, comments, code <> lines}
108    case Hash{}:
109      Scan{InComment{}, (at + 1: U32), line, code, Comment{at, at, line, code, ""}, comments, lines}
110    case DoubleQuote{}:
111      Scan{InQuote{True{}, False{}}, (at + 1: U32), line, True{}, open, comments, lines}
112    case SingleQuote{}:
113      Scan{InQuote{False{}, False{}}, (at + 1: U32), line, True{}, open, comments, lines}
114    case Blank{}:
115      Scan{InCode{}, (at + 1: U32), line, code, open, comments, lines}
116    case CarriageReturn{}:
117      Scan{InCode{}, (at + 1: U32), line, code, open, comments, lines}
118    case _:
119      Scan{InCode{}, (at + 1: U32), line, True{}, open, comments, lines}

Uses (8)

Used by (1)