summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2011-09-24 10:57:35 +0200
committerAraq <rumpf_a@web.de>2011-09-24 10:57:35 +0200
commit98e5beb936d8743b4d8e07fc47a0ab47e5f8a342 (patch)
tree52781ada5f5fba3ccdbb3e98007d7f2e636143c2
parentae0ab9a101fccfe8cdd8f2efa0ae2c73e396db7c (diff)
downloadNim-98e5beb936d8743b4d8e07fc47a0ab47e5f8a342.tar.gz
got rid of akPureObject
-rwxr-xr-xcompiler/ccgtypes.nim3
-rwxr-xr-xlib/core/typeinfo.nim9
-rwxr-xr-xlib/pure/marshal.nim4
3 files changed, 8 insertions, 8 deletions
diff --git a/compiler/ccgtypes.nim b/compiler/ccgtypes.nim
index 0123b69f9..20e3447b0 100755
--- a/compiler/ccgtypes.nim
+++ b/compiler/ccgtypes.nim
@@ -77,7 +77,8 @@ proc mapType(typ: PType): TCTypeKind =
   of tySet: result = mapSetType(typ)
   of tyOpenArray, tyArrayConstr, tyArray: result = ctArray
   of tyObject, tyTuple: result = ctStruct
-  of tyGenericBody, tyGenericInst, tyGenericParam, tyDistinct, tyOrdinal: 
+  of tyGenericBody, tyGenericInst, tyGenericParam, tyDistinct, tyOrdinal,
+     tyConst, tyMutable, tyIter: 
     result = mapType(lastSon(typ))
   of tyEnum: 
     if firstOrd(typ) < 0: 
diff --git a/lib/core/typeinfo.nim b/lib/core/typeinfo.nim
index b5e9e1a0f..b216fee0c 100755
--- a/lib/core/typeinfo.nim
+++ b/lib/core/typeinfo.nim
@@ -39,8 +39,7 @@ type
     akFloat = 36,       ## any represents a float
     akFloat32 = 37,     ## any represents a float32
     akFloat64 = 38,     ## any represents a float64
-    akFloat128 = 39,    ## any represents a float128
-    akPureObject = 40   ## any represents an object that has no `type` field
+    akFloat128 = 39     ## any represents a float128
 
   TAny* = object {.pure.} ## can represent any nimrod value; NOTE: the wrapped
                           ## value can be modified with its wrapper! This means
@@ -230,7 +229,7 @@ proc fieldsAux(p: pointer, n: ptr TNimNode,
 iterator fields*(x: TAny): tuple[name: string, any: TAny] =
   ## iterates over every active field of the any `x` that represents an object
   ## or a tuple.
-  assert x.rawType.kind in {tyTuple, tyPureObject, tyObject}
+  assert x.rawType.kind in {tyTuple, tyObject}
   var p = x.value
   var t = x.rawType
   # XXX BUG: does not work yet, however is questionable anyway
@@ -282,7 +281,7 @@ proc `[]=`*(x: TAny, fieldName: string, value: TAny) =
   # XXX BUG: does not work yet, however is questionable anyway
   when false:
     if x.rawType.kind == tyObject: t = cast[ptr PNimType](x.value)[]
-  assert x.rawType.kind in {tyTuple, tyPureObject, tyObject}
+  assert x.rawType.kind in {tyTuple, tyObject}
   var n = getFieldNode(x.value, t.node, fieldname)
   if n != nil:
     assert n.typ == value.rawType
@@ -296,7 +295,7 @@ proc `[]`*(x: TAny, fieldName: string): TAny =
   # XXX BUG: does not work yet, however is questionable anyway
   when false:
     if x.rawType.kind == tyObject: t = cast[ptr PNimType](x.value)[]
-  assert x.rawType.kind in {tyTuple, tyPureObject, tyObject}
+  assert x.rawType.kind in {tyTuple, tyObject}
   var n = getFieldNode(x.value, t.node, fieldname)
   if n != nil:
     result.value = x.value +!! n.offset
diff --git a/lib/pure/marshal.nim b/lib/pure/marshal.nim
index 354d70a71..8b062ef26 100755
--- a/lib/pure/marshal.nim
+++ b/lib/pure/marshal.nim
@@ -47,7 +47,7 @@ proc storeAny(s: PStream, a: TAny, stored: var TIntSet) =
         if i > 0: s.write(", ")

         storeAny(s, a[i], stored)

       s.write("]")

-  of akObject, akPureObject, akTuple:

+  of akObject, akTuple:

     s.write("{")

     var i = 0

     for key, val in fields(a):

@@ -138,7 +138,7 @@ proc loadAny(p: var TJsonParser, a: TAny, t: var TTable[biggestInt, pointer]) =
       else: raiseParseErr(p, "")

     else:
       raiseParseErr(p, "'[' expected for a seq")

-  of akObject, akPureObject, akTuple:

+  of akObject, akTuple:

     if a.kind == akObject: setObjectRuntimeType(a)
     if p.kind != jsonObjectStart: raiseParseErr(p, "'{' expected for an object")

     next(p)