Module toml.token stdlib

toml.token
Version:
0.3.3
License:
MIT
Dependencies from vmod:
0
Imports:
0
Imported by:
5
Repository:
OS-specific
Show selected OS-specific symbols.
Backend-specific
Show selected Backend-specific symbols.

Dependencies defined in v.mod

This section is empty.

Imports

This section is empty.

Aliases

This section is empty.

Constants

This section is empty.

Sum types

This section is empty.

Functions

This section is empty.

Structs

#struct Pos

pub 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

pub 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

inline
fn (tok &Token) pos() Pos

pos returns the exact position of a token in the input.

Interfaces

This section is empty.

Enums

#enum Kind

pub 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.