ast: minor cleanup of commented struct Field (#13231)
parent
05ff8f516d
commit
ffb263c2e1
|
@ -275,15 +275,13 @@ pub mut:
|
||||||
typ Type
|
typ Type
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
pub fn (f &StructField) equals(o &StructField) bool {
|
||||||
pub struct Field {
|
// TODO: f.is_mut == o.is_mut was removed here to allow read only access
|
||||||
pub:
|
// to (mut/not mut), but otherwise equal fields; some other new checks are needed:
|
||||||
name string
|
// - if node is declared mut, and we mutate node.stmts, all stmts fields must be mutable
|
||||||
pos token.Position
|
// - same goes for pub and global, if we call the field from another module
|
||||||
pub mut:
|
return f.name == o.name && f.typ == o.typ && f.is_pub == o.is_pub && f.is_global == o.is_global
|
||||||
typ Type
|
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
// const field in const declaration group
|
// const field in const declaration group
|
||||||
pub struct ConstField {
|
pub struct ConstField {
|
||||||
|
|
|
@ -922,31 +922,6 @@ pub:
|
||||||
types []Type
|
types []Type
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
pub struct Field {
|
|
||||||
pub:
|
|
||||||
name string
|
|
||||||
pub mut:
|
|
||||||
typ Type
|
|
||||||
default_expr Expr
|
|
||||||
has_default_expr bool
|
|
||||||
default_expr_typ Type
|
|
||||||
default_val string
|
|
||||||
attrs []Attr
|
|
||||||
is_pub bool
|
|
||||||
is_mut bool
|
|
||||||
is_global bool
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
pub fn (f &StructField) equals(o &StructField) bool {
|
|
||||||
// TODO: f.is_mut == o.is_mut was removed here to allow read only access
|
|
||||||
// to (mut/not mut), but otherwise equal fields; some other new checks are needed:
|
|
||||||
// - if node is declared mut, and we mutate node.stmts, all stmts fields must be mutable
|
|
||||||
// - same goes for pub and global, if we call the field from another module
|
|
||||||
return f.name == o.name && f.typ == o.typ && f.is_pub == o.is_pub && f.is_global == o.is_global
|
|
||||||
}
|
|
||||||
|
|
||||||
pub struct Array {
|
pub struct Array {
|
||||||
pub:
|
pub:
|
||||||
nr_dims int
|
nr_dims int
|
||||||
|
|
Loading…
Reference in New Issue