Skip to content

toml.token #

enum Kind #

enum Kind {
	unknown
	eof
	bare // user
	boolean // true or false
	number // 123
	quoted // 'foo', "foo", """foo""" or '''foo'''
	plus // +
	minus // -
	underscore // _
	comma // ,
	colon // :
	hash // # comment
	assign // =
	lcbr // {
	rcbr // }
	lsbr // [
	rsbr // ]
	nl // \n linefeed / newline character
	cr // \r carrige return
	tab // \t character
	whitespace // ` `
	period // .
	_end_
}

Kind represents a logical type of entity found in any given TOML document.

struct Pos #

struct Pos {
pub:
	len     int // length of the literal in the source
	line_nr int // the line number in the source where the token occured
	pos     int // the position of the token in scanner text
	col     int // the column in the source where the token occured
}

Position represents a position in a TOML document.

struct Token #

struct Token {
pub:
	kind    Kind   // the token number/enum; for quick comparisons
	lit     string // literal representation of the token
	col     int    // the column in the source where the token occured
	line_nr int    // the line number in the source where the token occured
	pos     int    // the position of the token in scanner text
	len     int    // length of the literal
}

Token holds information about the current scan of bytes.

fn (Token) pos #

fn (tok &Token) pos() Pos