~/bend-docscommunity

token.bend checks

raw source on the hub · import yaml-for-bend@0.1.0.0/token.bend as Token

The pieces the scanner hands the parser, and the errors both report.

1 import
import Base

Types

type Mark source · line 7 · raw

Data

A place in the text: the line and column (each from 0, a column counted in characters) and the character's index from the start.

type Style source · line 11 · raw

Data

How a scalar was written.

type Tok source · line 19 · raw

Data

A token, as libyaml names them. A scanner error ends the tokens with Broken.

type Token source · line 43 · raw

Data

type Cause source · line 48 · raw

Data

Why a text didn't load: it isn't YAML, or it is but the schema can't load it (a bad !!int, an unknown alias, a repeated key).

type Error source · line 55 · raw

Data

What went wrong, where, and why. A syntax error reads as a problem and what was being read: "did not find expected key while parsing a block mapping".

Definitions

def mark.line source · line 58 · raw

@m:Mark -> Nat

def mark.col source · line 63 · raw

@m:Mark -> Nat

def mark.idx source · line 68 · raw

@m:Mark -> Nat

def mark.show source · line 74 · raw

@m:Mark -> String

"at line 2 column 5", counting from 1.

def error.show source · line 81 · raw

@e:Error -> String

The error as one line: "mapping values are not allowed in this context at line 1 column 5".

def error.why source · line 86 · raw

@e:Error -> String

def error.at source · line 91 · raw

@e:Error -> Mark