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

compiler: circuimvent the dependency cycle v.ast <-> v.table

This commit is contained in:
Delyan Angelov
2020-05-02 22:51:55 +03:00
parent dbbfb04e7c
commit 7e4e3abc2c
4 changed files with 34 additions and 10 deletions

View File

@@ -12,7 +12,6 @@
module table
import strings
import v.ast
pub type Type int
@@ -536,12 +535,17 @@ pub:
foo string
}
// NB: FExpr here is a actually an ast.Expr .
// It should always be used by casting to ast.Expr, using ast.fe2ex()/ast.ex2fe()
// That hack is needed to break an import cycle between v.ast and v.table .
type FExpr = voidptr | byteptr
pub struct Field {
pub:
name string
mut:
typ Type
default_expr ast.Expr
default_expr FExpr
has_default_expr bool
default_val string
attr string