def skip
bolt@1.27.0.0 · src/rules/suspicious/prefix.bend:151
import bolt@1.27.0.0/src/rules/suspicious/prefix.bend as Prefix
import Base
import bolt@1.27.0.0/src/syntax/lex.bend as Lex
151
152
153
154
155def skip(toks: List<&2, Lex.Tok>, sk: Skip, +acc: List<&2, String>) -> Maybe<&2, Arg>:
156 match toks:
157 case Nil{}:
158 None{}
159 case Con{Lex.Tok{+k, +t, l, c}, rest}:
160 match sk:
161 case SComma{}:
162 Some{Arg{String.join(List.reverse(&2, String, acc), ""), Lex.Tok{k, t, l, c} <> rest}}
163 case SClose{}:
164 None{}
165 case SGo{dd}:
166 +nx = skip.step(k, dd)
167 skip(rest, nx, skip.piece(nx, k, t) <> acc)