summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeFilesLines
* implemented large parts of the 'not nil' checkingAraq2013-06-0921-112/+293
|
* implemented dataflow analysis; activate via --warning[Uninit]:onAraq2013-06-046-26/+185
|
* fixes #456Araq2013-06-041-9/+10
|
* fixes #451Araq2013-06-042-1/+15
|
* new scoping rules for 'if' now activeAraq2013-06-044-4/+6
|
* manyloc test should be green againAraq2013-06-045-32/+22
|
* tiny doc improvementAraq2013-06-032-6/+0
|
* fixes semicolon parsing issueAraq2013-06-033-6/+15
|
* fixes #385Araq2013-06-033-4/+544
|
* Merge branch 'master' of github.com:Araq/NimrodAraq2013-06-021-1/+1
|\
| * Added unittest module to docgen.Dominik Picheta2013-05-311-1/+1
| |
* | astToStr is now immediateAraq2013-06-024-6/+28
| |
* | next steps to a luajit codegenAraq2013-06-021-71/+248
|/
* more accurate effects for times.nim; bugfix for the JS codegenAraq2013-05-312-52/+54
|
* Merge branch 'master' of github.com:Araq/NimrodAraq2013-05-311-1/+3
|\
| * Merge pull request #455 from fowlmouth/patch-7Araq2013-05-301-1/+3
| |\ | | | | | | rename json.existsKey to hasKey, deprecates existsKey
| | * rename json.existsKey to hasKey, deprecates existsKeyBillingsly Wetherfordshire2013-05-271-1/+3
| | |
* | | fixes #458Araq2013-05-312-4/+7
| | |
* | | another attempt to implement #448Araq2013-05-311-10/+7
| | |
* | | better error message for subtle nil errorsAraq2013-05-314-3/+8
|/ /
* | Revert "fixes #267"Araq2013-05-275-184/+97
| | | | | | | | This reverts commit 7fccdedcb5d1e583039b2ea2ae6564412a0f5104.
* | Revert "bugfix: emulated thread vars used in combination with the mark & ↵Araq2013-05-273-11/+4
| | | | | | | | | | | | sweep GC" This reverts commit 420789c2782be7b969ad02448841d90bd0d17a1f.
* | Revert "allow `void` as a field type"Araq2013-05-272-42/+26
| | | | | | | | This reverts commit aea27a7ce4a263122e0a053afa864ee76baaf8d5.
* | Revert "allow keyword params for the `[]` and `{}` operators"Araq2013-05-271-12/+8
| | | | | | | | This reverts commit bfff1ac8b2435595351194f6c4b1268d38301401.
* | Revert "static and default params for generics"Araq2013-05-274-92/+61
| | | | | | | | This reverts commit 46813bbe4e1423181521d4792b9af7593f48fa1f.
* | Revert "fix tforwardgeneric"Araq2013-05-274-8/+6
| | | | | | | | This reverts commit d82a032566de1612ff1ed2d82cc7ec2bd58267d7.
* | Revert "fix threading tests"Araq2013-05-272-17/+9
| | | | | | | | This reverts commit d5fffc032f2b390abd7b4c4fea2e49b1a0ef9736.
* | Revert "further fixes for void stripping. fixes tvoid."Araq2013-05-271-25/+20
| | | | | | | | This reverts commit 4ae4005f805c5b2e329b2e060fcf40169238a9f9.
* | Revert "more test made green"Araq2013-05-276-96/+89
| | | | | | | | This reverts commit 911e6e710f28f454cf8bc1bb493c1a28c4694b76.
* | Revert "test cases for the new features"Araq2013-05-274-78/+4
|/ | | | This reverts commit 66653e8f144f2e67a6e48158f9298d9f41b16b09.
* test cases for the new featuresZahary Karadjov2013-05-264-4/+78
|
* more test made greenZahary Karadjov2013-05-266-89/+96
| | | | | | | | | the lambda lifting was trying too hard to ignore generic prods isGenericRoutine was producing false-negatives and only this allowed for some of the warning and error messages to be triggered. some files with mixed line endings were fixed
* further fixes for void stripping. fixes tvoid.Zahary Karadjov2013-05-261-20/+25
|
* fix threading testsZahary Karadjov2013-05-262-9/+17
| | | | | * more type names are valid expressions now * void is properly stripped off during generic instantiation
* fix tforwardgenericZahary Karadjov2013-05-264-6/+8
|
* static and default params for genericsZahary Karadjov2013-05-264-61/+92
|
* allow keyword params for the `[]` and `{}` operatorsZahary Karadjov2013-05-261-8/+12
| | | | | | | conceptually, these operators are not very different from regular procs in the way they are defined and overloaded. keyword params for them are admittedly less useful, but they improve consistency and may help with generic instantiations once default generic parameters are supported.
* allow `void` as a field typeZahary Karadjov2013-05-262-26/+42
|
* bugfix: emulated thread vars used in combination with the mark & sweep GCZahary Karadjov2013-05-263-4/+11
| | | | resulted in invalid code generation
* fixes #267Zahary Karadjov2013-05-265-97/+184
|
* fixes #411Araq2013-05-261-8/+12
|
* implements #448Araq2013-05-261-3/+10
|
* implements #397Araq2013-05-262-1/+13
|
* preparations for version 0.9.4Araq2013-05-252-1/+27
|
* Merge branch 'master' of github.com:Araq/NimrodAraq2013-05-251-2/+5
|\
| * Fixed overflow in sockets.parseIP4.Dominik Picheta2013-05-241-2/+5
| |
* | added FAQ about 'proc'Araq2013-05-252-8/+12
|/
* Merge branch 'master' of github.com:Araq/NimrodAraq2013-05-243-4/+124
|\
| * Merge pull request #445 from gradha/pr_web_improvementsAraq2013-05-233-4/+124
| |\ | | | | | | Some web improvements
| | * Implements basic rss generation for website news.Grzegorz Adam Hankiewicz2013-05-232-3/+122
| | |
"o">: if mt.base != nil: genericAssignAux(dest, src, mt.base, shallow) genericAssignAux(dest, src, mt.node, shallow) # we need to copy m_type field for tyObject, as it could be empty for # sequence reallocations: var pint = cast[ptr PNimType](dest) # We need to copy the *static* type not the dynamic type: # if p of TB: # var tbObj = TB(p) # tbObj of TC # needs to be false! pint[] = mt # cast[ptr PNimType](src)[] of tyTuple: genericAssignAux(dest, src, mt.node, shallow) of tyArray, tyArrayConstr: for i in 0..(mt.size div mt.base.size)-1: genericAssignAux(cast[pointer](d +% i*% mt.base.size), cast[pointer](s +% i*% mt.base.size), mt.base, shallow) of tyRef: unsureAsgnRef(cast[PPointer](dest), cast[PPointer](s)[]) else: copyMem(dest, src, mt.size) # copy raw bits proc genericAssign(dest, src: pointer, mt: PNimType) {.compilerProc.} = genericAssignAux(dest, src, mt, false) proc genericShallowAssign(dest, src: pointer, mt: PNimType) {.compilerProc.} = genericAssignAux(dest, src, mt, true) when false: proc debugNimType(t: PNimType) = if t.isNil: cprintf("nil!") return var k: cstring case t.kind of tyBool: k = "bool" of tyChar: k = "char" of tyEnum: k = "enum" of tyArray: k = "array" of tyObject: k = "object" of tyTuple: k = "tuple" of tyRange: k = "range" of tyPtr: k = "ptr" of tyRef: k = "ref" of tyVar: k = "var" of tySequence: k = "seq" of tyProc: k = "proc" of tyPointer: k = "range" of tyOpenArray: k = "openarray" of tyString: k = "string" of tyCString: k = "cstring" of tyInt: k = "int" of tyInt32: k = "int32" else: k = "other" cprintf("%s %ld\n", k, t.size) debugNimType(t.base) proc genericSeqAssign(dest, src: pointer, mt: PNimType) {.compilerProc.} = var src = src # ugly, but I like to stress the parser sometimes :-) genericAssign(dest, addr(src), mt) proc genericAssignOpenArray(dest, src: pointer, len: int, mt: PNimType) {.compilerproc.} = var d = cast[ByteAddress](dest) s = cast[ByteAddress](src) for i in 0..len-1: genericAssign(cast[pointer](d +% i*% mt.base.size), cast[pointer](s +% i*% mt.base.size), mt.base) proc objectInit(dest: pointer, typ: PNimType) {.compilerProc, benign.} proc objectInitAux(dest: pointer, n: ptr TNimNode) {.benign.} = var d = cast[ByteAddress](dest) case n.kind of nkNone: sysAssert(false, "objectInitAux") of nkSlot: objectInit(cast[pointer](d +% n.offset), n.typ) of nkList: for i in 0..n.len-1: objectInitAux(dest, n.sons[i]) of nkCase: var m = selectBranch(dest, n) if m != nil: objectInitAux(dest, m) proc objectInit(dest: pointer, typ: PNimType) = # the generic init proc that takes care of initialization of complex # objects on the stack or heap var d = cast[ByteAddress](dest) case typ.kind of tyObject: # iterate over any structural type # here we have to init the type field: var pint = cast[ptr PNimType](dest) pint[] = typ objectInitAux(dest, typ.node) of tyTuple: objectInitAux(dest, typ.node) of tyArray, tyArrayConstr: for i in 0..(typ.size div typ.base.size)-1: objectInit(cast[pointer](d +% i * typ.base.size), typ.base) else: discard # nothing to do # ---------------------- assign zero ----------------------------------------- proc nimDestroyRange[T](r: T) {.compilerProc.} = # internal proc used for destroying sequences and arrays mixin `=destroy` for i in countup(0, r.len - 1): `=destroy`(r[i]) proc genericReset(dest: pointer, mt: PNimType) {.compilerProc, benign.} proc genericResetAux(dest: pointer, n: ptr TNimNode) = var d = cast[ByteAddress](dest) case n.kind of nkNone: sysAssert(false, "genericResetAux") of nkSlot: genericReset(cast[pointer](d +% n.offset), n.typ) of nkList: for i in 0..n.len-1: genericResetAux(dest, n.sons[i]) of nkCase: var m = selectBranch(dest, n) if m != nil: genericResetAux(dest, m) zeroMem(cast[pointer](d +% n.offset), n.typ.size) proc genericReset(dest: pointer, mt: PNimType) = var d = cast[ByteAddress](dest) sysAssert(mt != nil, "genericReset 2") case mt.kind of tyString, tyRef, tySequence: unsureAsgnRef(cast[PPointer](dest), nil) of tyTuple: genericResetAux(dest, mt.node) of tyObject: genericResetAux(dest, mt.node) # also reset the type field for tyObject, for correct branch switching! var pint = cast[ptr PNimType](dest) pint[] = nil of tyArray, tyArrayConstr: for i in 0..(mt.size div mt.base.size)-1: genericReset(cast[pointer](d +% i*% mt.base.size), mt.base) else: zeroMem(dest, mt.size) # set raw bits to zero proc selectBranch(discVal, L: int, a: ptr array [0..0x7fff, ptr TNimNode]): ptr TNimNode = result = a[L] # a[L] contains the ``else`` part (but may be nil) if discVal <% L: var x = a[discVal] if x != nil: result = x proc FieldDiscriminantCheck(oldDiscVal, newDiscVal: int, a: ptr array [0..0x7fff, ptr TNimNode], L: int) {.compilerProc.} = var oldBranch = selectBranch(oldDiscVal, L, a) var newBranch = selectBranch(newDiscVal, L, a) if newBranch != oldBranch and oldDiscVal != 0: sysFatal(FieldError, "assignment to discriminant changes object branch")