~/bend-docscommunity

token.bend checks

raw source on the hub · import yaml-for-bend@0.1.1.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 49 · raw

Data

Why a text didn't load: it isn't YAML; it is, but the schema can't load it (a bad !!int, an unknown alias, a repeated key); or it would pass one of the limits a load sets (its size, its depth, its aliases).

type Error source · line 57 · 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 60 · raw

@m:Mark -> Nat

def mark.col source · line 65 · raw

@m:Mark -> Nat

def mark.idx source · line 70 · raw

@m:Mark -> Nat

def mark.show source · line 76 · raw

@m:Mark -> String

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

def error.show source · line 83 · 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 88 · raw

@e:Error -> String

def error.at source · line 93 · raw

@e:Error -> Mark