Module toml.ast stdlib

toml.ast
Version:
0.3.3
License:
MIT
Dependencies from vmod:
0
Imports:
3
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

Aliases

This section is empty.

Constants

This section is empty.

Sum types

#type Key

pub type Key = Bare | Bool | Null | Number | Quoted

Key is a sumtype representing all types of keys that can be found in a TOML document.

#fn (Key) str

fn (k Key) str() string

str returns the string representation of the key. This is implemented by all the variants of Key.

#type Value

pub type Value = Bool

Value is a sumtype representing all possible value types found in a TOML document.

#fn (Value) str

fn (v Value) str() string

str outputs the value in JSON-like format for eased debugging

#type DateTimeType

pub type DateTimeType = Date | DateTime | Time

DateTimeType is a sumtype representing all possible date types found in a TOML document.

fn (dtt DateTimeType) str() string

str returns the string representation of the DateTimeType type.

Functions

This section is empty.

Structs

#struct Root

heap
pub struct Root {
pub:
	input input.Config // User input configuration
pub mut:
	comments []Comment
	table    Value
	// errors           []errors.Error    // all the checker errors in the file
}

Root represents the root structure of any parsed TOML text snippet or file.

#fn (Root) str

fn (r Root) str() string

str returns the string representation of the root node.

#struct Comment

pub struct Comment {
pub:
	text string
	pos  token.Pos
}

Comment is the data representation of a TOML comment (## This is a comment).

#fn (Comment) str

fn (c Comment) str() string

str returns the string representation of the Comment type.

#struct Null

pub struct Null {
pub:
	text string
	pos  token.Pos
}

Null is used in sumtype checks as a "default" value when nothing else is possible.

#fn (Null) str

fn (n Null) str() string

str returns the string representation of the Null type

#struct Quoted

pub struct Quoted {
pub mut:
	text string
pub:
	pos          token.Pos
	is_multiline bool
	quote        u8
}

Quoted is the data representation of a TOML quoted type ("quoted-key" = "I'm a quoted value").

Quoted types can appear both as keys and values in TOML documents.

#fn (Quoted) str

fn (q Quoted) str() string

str returns the string representation of the Quoted type.

#struct Bare

pub struct Bare {
pub:
	text string
	pos  token.Pos
}

Bare is the data representation of a TOML bare type (bare_key = ...).

Bare types can appear only as keys in TOML documents. Otherwise they take the form of Bool or Numbers.

#fn (Bare) str

fn (b Bare) str() string

str returns the string representation of the Bare type.

#struct Bool

pub struct Bool {
pub:
	text string
	pos  token.Pos
}

Bool is the data representation of a TOML boolean type (... = true).

Bool types can appear only as values in TOML documents. Keys named true or false are considered as Bare types.

#fn (Bool) str

fn (b Bool) str() string

str returns the string representation of the Bool type.

#struct Number

pub struct Number {
pub:
	pos token.Pos
pub mut:
	text string
}

Number is the data representation of a TOML number type (25 = 5e2).

Number types can appear both as keys and values in TOML documents.

Number can be integers, floats, infinite, NaN - they can have exponents (5e2) and be sign prefixed (+2).

#fn (Number) str

fn (n Number) str() string

str returns the string representation of the Number type.

#fn (Number) i64

fn (n Number) i64() i64

i64 returns the n Number as an i64 value.

#fn (Number) f64

fn (n Number) f64() f64

f64 returns the n Number as an f64 value.

#struct Date

pub struct Date {
pub:
	text string
	pos  token.Pos
}

Date is the data representation of a TOML date type (YYYY-MM-DD).

Date types can appear both as keys and values in TOML documents.

Keys named like dates e.g. 1980-12-29 are considered Bare key types.

#fn (Date) str

fn (d Date) str() string

str returns the string representation of the Date type.

#struct Time

pub struct Time {
pub:
	text   string
	offset int
	pos    token.Pos
}

Time is the data representation of a TOML time type (HH:MM:SS.milli).

Time types can appear only as values in TOML documents.

#fn (Time) str

fn (t Time) str() string

str returns the string representation of the Time type.

#struct DateTime

pub struct DateTime {
pub mut:
	text string
pub:
	pos  token.Pos
	date Date
	time Time
}

DateTime is the data representation of a TOML date-time type (YYYY-MM-DDTHH:MM:SS.milli).

DateTime types can appear only as values in TOML documents.

#fn (DateTime) str

fn (dt DateTime) str() string

str returns the string representation of the DateTime type.

#struct EOF

pub struct EOF {
pub:
	pos token.Pos
}

EOF is the data representation of the end of the TOML document.

#fn (EOF) str

fn (e EOF) str() string

str returns the string representation of the EOF type.

Interfaces

This section is empty.

Enums

This section is empty.