Skip to content

Commit

Permalink
delete old type, use the new sumtype type
Browse files Browse the repository at this point in the history
  • Loading branch information
medvednikov committed Aug 23, 2024
1 parent ea8f3d2 commit e3c435e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
11 changes: 3 additions & 8 deletions ast.v
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type Stmt = AssignStmt

struct InvalidExpr {}

type Type2 = StructType | ArrayType | Ident | StarExpr | SelectorExpr
type Type = StructType | ArrayType | Ident | StarExpr | SelectorExpr

struct GoFile {
name Ident @[json: 'Name']
Expand Down Expand Up @@ -67,7 +67,7 @@ struct Spec {
names []Ident @[json: 'Names']
values []Expr @[json: 'Values']
// typ Type @[json: 'Type']
typ Type2 @[json: 'Type']
typ Type @[json: 'Type']
args []Expr @[json: 'Args']
path BasicLit @[json: 'Path']
}
Expand Down Expand Up @@ -152,11 +152,6 @@ struct AssignStmt {
tok string @[json: 'Tok']
}

struct Type {
node_type_str string @[json: '_type']
fields FieldList @[json: 'Fields']
}

struct StructType {
node_type_str string @[json: '_type']
fields FieldList @[json: 'Fields']
Expand All @@ -170,7 +165,7 @@ struct Field {
node_type_str string @[json: '_type']
names []Ident @[json: 'Names']
// typ TypeOrIdent @[json: 'Type']
typ Type2 @[json: 'Type']
typ Type @[json: 'Type']
}

struct Ident {
Expand Down
2 changes: 1 addition & 1 deletion main.v
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ fn (mut app App) generate_v_code(go_file GoFile) string {
return app.sb.str()
}

fn (mut app App) typ(t Type2) {
fn (mut app App) typ(t Type) {
app.force_upper = true
match t {
Ident {
Expand Down

0 comments on commit e3c435e

Please sign in to comment.