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:
@@ -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'
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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 }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user