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

builtin: add more fields to FieldData (will be implemented later in a PR, to ease bootstrapping)

This commit is contained in:
Delyan Angelov 2022-12-26 16:05:14 +02:00
parent 94a36c5ca4
commit 3d545ee0cd
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED

View File

@ -110,13 +110,24 @@ pub:
// FieldData holds information about a field. Fields reside on structs.
pub struct FieldData {
pub:
name string
attrs []string
is_pub bool
is_mut bool
is_shared bool
typ int
unaliased_typ int
name string // the name of the field f
typ int // the internal TypeID of the field f,
unaliased_typ int // if f's type was an alias of int, this will be TypeID(int)
//
attrs []string // the attributes of the field f
is_pub bool // f is in a `pub:` section
is_mut bool // f is in a `mut:` section
//
is_shared bool // `f shared Abc`
is_atomic bool // `f atomic int` , TODO
is_optional bool // `f ?string` , TODO
//
is_array bool // `f []string` , TODO
is_map bool // `f map[string]int` , TODO
is_chan bool // `f chan int` , TODO
is_struct bool // `f Abc` where Abc is a struct , TODO
//
indirections u8 // 0 for `f int`, 1 for `f &int`, 2 for `f &&int` , TODO
}
pub enum AttributeKind {