diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2009-06-08 08:06:25 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2009-06-08 08:06:25 +0200 |
commit | 4d4b3b1c04d41868ebb58bd9ccba7b303007e900 (patch) | |
tree | 909ed0aad0b145733521f4ac2bfb938dd4b43785 /lib/system/hti.nim | |
parent | ce88dc3e67436939b03f97e624c11ca6058fedce (diff) | |
download | Nim-4d4b3b1c04d41868ebb58bd9ccba7b303007e900.tar.gz |
version0.7.10
Diffstat (limited to 'lib/system/hti.nim')
-rw-r--r-- | lib/system/hti.nim | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/lib/system/hti.nim b/lib/system/hti.nim new file mode 100644 index 000000000..dd74bfa3f --- /dev/null +++ b/lib/system/hti.nim @@ -0,0 +1,65 @@ +# +# +# Nimrod's Runtime Library +# (c) Copyright 2009 Andreas Rumpf +# +# See the file "copying.txt", included in this +# distribution, for details about the copyright. +# + +type # This should be he same as ast.TTypeKind + # some enum fields are not used at runtime + TNimKind = enum + tyNone, # 0 + tyBool, # 1 + tyChar, # 2 + tyEmpty, # 3 + tyArrayConstr, # 4 + tyNil, # 5 + tyGeneric, # 6 + tyGenericInst, # 7 + tyGenericParam, # 8 + tyAbstract, # 9 + tyEnum, # 10 + tyOrdinal, # 11 + tyArray, # 12 + tyObject, # 13 + tyTuple, # 14 + tySet, # 15 + tyRange, # 16 + tyPtr, # 17 + tyRef, # 18 + tyVar, # 19 + tySequence, # 20 + tyProc, # 21 + tyPointer, # 22 + tyOpenArray, # 23 + tyString, # 24 + tyCString, # 25 + tyForward, # 26 + tyInt, tyInt8, tyInt16, tyInt32, tyInt64, + tyFloat, tyFloat32, tyFloat64, tyFloat128, + tyPureObject # 36: signals that object has no `n_type` field + + TNimNodeKind = enum nkNone, nkSlot, nkList, nkCase + TNimNode {.compilerproc, final.} = object + kind: TNimNodeKind + offset: int + typ: ptr TNimType + name: Cstring + len: int + sons: ptr array [0..0x7fff, ptr TNimNode] + + TNimTypeFlag = enum + ntfNoRefs = 0, # type contains no tyRef, tySequence, tyString + ntfAcyclic = 1 # type cannot form a cycle + TNimType {.compilerproc, final.} = object + size: int + kind: TNimKind + flags: set[TNimTypeFlag] + base: ptr TNimType + node: ptr TNimNode # valid for tyRecord, tyObject, tyTuple, tyEnum + finalizer: pointer # the finalizer for the type + PNimType = ptr TNimType + +# node.len may be the ``first`` element of a set |