def Scan.in_comment

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

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

121def Scan.in_comment(
122  glyph: Glyph,
123  c: Char,
124  +at: U32,
125  line: U32,
126  code: Bool,
127  open: Comment,
128  comments: List<&2, Comment>,
129  lines: List<&2, Bool>
130) -> Scan:
131  match glyph:
132    case LineEnd{}:
133      Scan{
134        InCode{},
135        (at + 1: U32),
136        (line + 1: U32),
137        False{},
138        Comment.none(),
139        Comment.closed(open, at) <> comments,
140        code <> lines
141      }
142    case CarriageReturn{}:
143      Scan{
144        InCode{},
145        (at + 1: U32),
146        line,
147        code,
148        Comment.none(),
149        Comment.closed(open, at) <> comments,
150        lines
151      }
152    case _:
153      Scan{InComment{}, (at + 1: U32), line, code, Comment.push(open, c), comments, lines}

Uses (12)

Used by (1)