diff --git a/vlib/v/ast/init.v b/vlib/v/ast/init.v index 0ee69ea2b9..4bda1ac17b 100644 --- a/vlib/v/ast/init.v +++ b/vlib/v/ast/init.v @@ -1,7 +1,5 @@ module ast -import v.ast - pub fn resolve_init(node StructInit, typ Type, t &Table) Expr { type_sym := t.get_type_symbol(typ) if type_sym.kind == .array { @@ -32,7 +30,7 @@ pub fn resolve_init(node StructInit, typ Type, t &Table) Expr { } } } - return ast.ArrayInit{ + return ArrayInit{ // TODO: mod is not being set for now, we could need this in future // mod: mod pos: node.pos @@ -51,12 +49,12 @@ pub fn resolve_init(node StructInit, typ Type, t &Table) Expr { mut keys := []Expr{} mut vals := []Expr{} for field in node.fields { - keys << ast.StringLiteral{ + keys << StringLiteral{ val: field.name } vals << field.expr } - return ast.MapInit{ + return MapInit{ typ: typ key_type: map_info.key_type value_type: map_info.value_type @@ -65,7 +63,7 @@ pub fn resolve_init(node StructInit, typ Type, t &Table) Expr { } } // struct / other (sumtype?) - return ast.StructInit{ + return StructInit{ ...node unresolved: false } diff --git a/vlib/v/ast/scope.v b/vlib/v/ast/scope.v index 1a9b3ba114..e4a149135d 100644 --- a/vlib/v/ast/scope.v +++ b/vlib/v/ast/scope.v @@ -3,8 +3,6 @@ // that can be found in the LICENSE file. module ast -import v.ast - pub struct Scope { pub mut: // mut: @@ -18,7 +16,7 @@ pub mut: } pub fn new_scope(parent &Scope, start_pos int) &Scope { - return &ast.Scope{ + return &Scope{ parent: parent start_pos: start_pos } diff --git a/vlib/v/ast/str.v b/vlib/v/ast/str.v index 843d1fdcdb..2bc64d2b19 100644 --- a/vlib/v/ast/str.v +++ b/vlib/v/ast/str.v @@ -3,7 +3,6 @@ // that can be found in the LICENSE file. module ast -import v.ast import v.util import strings @@ -117,7 +116,7 @@ pub fn (node &FnDecl) stringify(t &Table, cur_mod string, m2a map[string]string) } } f.write_string(')') - if node.return_type != ast.void_type { + if node.return_type != void_type { mut rs := util.no_cur_mod(t.type_to_str(node.return_type), cur_mod) for mod, alias in m2a { rs = rs.replace(mod, alias)