diff options
Diffstat (limited to 'compiler/semdata.nim')
-rw-r--r-- | compiler/semdata.nim | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/compiler/semdata.nim b/compiler/semdata.nim index 2e920d9cf..980abb865 100644 --- a/compiler/semdata.nim +++ b/compiler/semdata.nim @@ -218,6 +218,16 @@ proc makeTypeFromExpr*(c: PContext, n: PNode): PType = result = newTypeS(tyFromExpr, c) result.n = n +proc newTypeWithSons*(c: PContext, kind: TTypeKind, + sons: seq[PType]): PType = + result = newType(kind, getCurrOwner()) + result.sons = sons + +proc makeStaticExpr*(c: PContext, n: PNode): PNode = + result = newNodeI(nkStaticExpr, n.info) + result.sons = @[n] + result.typ = newTypeWithSons(c, tyStatic, @[n.typ]) + proc makeAndType*(c: PContext, t1, t2: PType): PType = result = newTypeS(tyAnd, c) result.sons = @[t1, t2] @@ -238,11 +248,6 @@ proc makeNotType*(c: PContext, t1: PType): PType = proc newTypeS(kind: TTypeKind, c: PContext): PType = result = newType(kind, getCurrOwner()) -proc newTypeWithSons*(c: PContext, kind: TTypeKind, - sons: seq[PType]): PType = - result = newType(kind, getCurrOwner()) - result.sons = sons - proc errorType*(c: PContext): PType = ## creates a type representing an error state result = newTypeS(tyError, c) |