module

Krikri::Lint::YamlTokens

Minimal YAML token scanner, used by the token-level yamllint rules (yaml[commas], yaml[colons]). Those rules only compare the whitespace gap between adjacent tokens, so the scanner emits just enough of a token stream - the punctuation tokens themselves plus whatever scalar/indicator token serves as their prev/next.

It follows pyyaml's scanner (the one yamllint runs on) for the decisions that change token boundaries: quote spans, comment starts, flow-context indicators, and where a plain scalar ends. Lines that are continuation content of a multi-line scalar are skipped wholesale (the parse tree already knows which ones).

Constants

FLOW_INDICATORS = [',', '?', '[', ']', '{', '}']
WHITESPACE = [' ', '\t']

Instance methods

scan(file : PositionedFile) : Array(Token)
Source

Nested types