ast: minor cleanup of commented struct Field (#13231)

pull/13246/head
yuyi 2022-01-21 21:00:21 +08:00 committed by GitHub
parent 05ff8f516d
commit ffb263c2e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 33 deletions

View File

@ -275,15 +275,13 @@ pub mut:
typ Type
}
/*
pub struct Field {
pub:
name string
pos token.Position
pub mut:
typ Type
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
}
*/
// const field in const declaration group
pub struct ConstField {

View File

@ -922,31 +922,6 @@ pub:
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:
nr_dims int