layout/format.bend fails
raw source on the hub · import bend-lint-rules@0.1.0.0/layout/format.bend as Format
layout/format: a file that differs from its formatted text, where it first differs. One formatter owns indentation, spacing, declaration gaps and wrapping. Fix: writes the formatted text. Options: tabWidth (2); wrapAtWidth (100, or "never": no optional wrapping); endOfLine ("lf", "crlf", or "preserve": the file's first, or LF if it has none). Heuristics: it reads tokens, not Bend's syntax, and changes only blanks, line breaks and the space after a comment's #, so a fix keeps the program. A form its token rules do not know can come out laid out oddly.
A String is a JS string at run time: ++ is native, and a match on SCon reads one character and slices off the rest. So the lexer reads the text once, tokens carry what the layout asks of them, and docs carry widths.
Each loop is go(input, state): a step that does not recurse makes the next state, so every loop recurses on a smaller part of its input. The lexer and the printer recurse on fuel instead: more steps than they can need.
3 imports
import Base import bend-lint-api@0.1.0.0/linter/lint.bend as Lint import bend-lint-api@0.1.0.0/shared/strings.bend as Strings
The reader could not load this file (at 0x2b0a0dcada30f71a8eb4ec2e148b9279/linter/lint.bend:522). What bend.ts says:
Error:
- expected : a fresh constructor name (duplicate declaration: Text)
- observed : 'Text'
Location:
521 | Flag{on: Bool}
522>| Text{text: String}
| ^^^^
523 |