1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

toml: update value_opt syntax and add missing documentation (#16510)

This commit is contained in:
Subhomoy Haldar
2022-11-22 17:45:12 +00:00
committed by GitHub
parent 7c7ebd648d
commit f7a11b8e50
9 changed files with 18 additions and 2 deletions

View File

@@ -16,6 +16,7 @@ pub mut:
// errors []errors.Error // all the checker errors in the file
}
// str returns the string representation of the root node.
pub fn (r Root) str() string {
mut s := typeof(r).name + '{\n'
s += ' input: ${r.input}\n'

View File

@@ -10,6 +10,8 @@ import strconv
// can be found in a TOML document.
pub type Key = Bare | Bool | Null | Number | Quoted
// str returns the string representation of the key. This is implemented
// by all the variants of Key.
pub fn (k Key) str() string {
return k.text
}

View File

@@ -20,6 +20,7 @@ mut:
data voidptr
}
// visit calls the inspector callback on the specified Value node.
pub fn (i &Inspector) visit(value &ast.Value) ! {
i.inspector_callback(value, i.data) or { return err }
}