Module toml.checker stdlib

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

Dependencies defined in v.mod

This section is empty.

Imported by

Aliases

This section is empty.

Constants

#constant allowed_basic_escape_chars

pub const allowed_basic_escape_chars = [`u`, `U`, `b`, `t`, `n`, `f`, `r`, `"`, `\\`]

Sum types

This section is empty.

Functions

This section is empty.

Structs

#struct Checker

pub struct Checker {
	scanner &scanner.Scanner = unsafe { nil }
}

Checker checks a tree of TOML ast.Value's for common errors.

#fn (Checker) check

fn (c Checker) check(n &toml.ast.Value) !

check checks the ast.Value and all it's children for common errors.

#fn (Checker) visit

fn (c Checker) visit(value &toml.ast.Value) !

#fn (Checker) excerpt

fn (c Checker) excerpt(tp toml.token.Pos) string

excerpt returns a string of the token's surroundings

#fn (Checker) check_number

fn (c Checker) check_number(num toml.ast.Number) !

check_number returns an error if num is not a valid TOML number.

#fn (Checker) is_valid_binary_literal

fn (c Checker) is_valid_binary_literal(num string) bool

is_valid_binary_literal returns true if num is valid TOML binary literal.

#fn (Checker) is_valid_octal_literal

fn (c Checker) is_valid_octal_literal(num string) bool

is_valid_octal_literal returns true if num is valid TOML octal literal.

#fn (Checker) is_valid_hex_literal

fn (c Checker) is_valid_hex_literal(num string) bool

is_valid_hex_literal returns true if num is valid TOML hexadecimal literal.

#fn (Checker) check_boolean

fn (c Checker) check_boolean(b toml.ast.Bool) !

check_boolean returns an error if b is not a valid TOML boolean.

#fn (Checker) check_date_time

fn (c Checker) check_date_time(dt toml.ast.DateTime) !

check_date_time returns an error if dt is not a valid TOML date-time string (RFC 3339).

See also https://ijmacd.github.io/rfc3339-iso8601 for a more visual representation of the RFC 3339 format.

#fn (Checker) check_date

fn (c Checker) check_date(date toml.ast.Date) !

check_time returns an error if date is not a valid TOML date string (RFC 3339).

#fn (Checker) check_time

fn (c Checker) check_time(t toml.ast.Time) !

check_time returns an error if t is not a valid TOML time string (RFC 3339).

#fn (Checker) check_quoted

fn (c Checker) check_quoted(q toml.ast.Quoted) !

check_quoted returns an error if q is not a valid quoted TOML string.

#fn (Checker) check_quoted_escapes

fn (c Checker) check_quoted_escapes(q toml.ast.Quoted) !

check_quoted_escapes returns an error for any disallowed escape sequences.

Delimiters in TOML has significant meaning:

'/''' delimits literal strings (WYSIWYG / What-you-see-is-what-you-get) "/""" delimits basic strings Allowed escapes in basic strings are:

\b - backspace (U+0008) \t - tab (U+0009) \n - linefeed (U+000A) \f - form feed (U+000C) \r - carriage return (U+000D) " - quote (U+0022) \ - backslash (U+005C) \uXXXX - Unicode (U+XXXX) \UXXXXXXXX - Unicode (U+XXXXXXXX)

#fn (Checker) check_utf8_validity

fn (c Checker) check_utf8_validity(q toml.ast.Quoted) !

check_utf8_string returns an error if str is not valid UTF-8.

#fn (Checker) check_unicode_escape

fn (c Checker) check_unicode_escape(esc_unicode string) !

check_unicode_escape returns an error if esc_unicode is not a valid Unicode escape sequence. esc_unicode is expected to be prefixed with either u or U.

#fn (Checker) check_comment

fn (c Checker) check_comment(comment toml.ast.Comment) !

check_comment returns an error if the contents of comment isn't a valid TOML comment.

Interfaces

This section is empty.

Enums

This section is empty.