Merge remote-tracking branch 'upstream/devel' into devel

This commit is contained in:
PhilipWitte 2015-02-20 08:50:45 -08:00
commit 53c83c4510
8 changed files with 13 additions and 14 deletions

View file

@ -756,6 +756,9 @@ proc semOverloadedCallAnalyseEffects(c: PContext, n: PNode, nOrig: PNode,
else: else:
if callee.kind in skIterators and callee.id == c.p.owner.id: if callee.kind in skIterators and callee.id == c.p.owner.id:
localError(n.info, errRecursiveDependencyX, callee.name.s) localError(n.info, errRecursiveDependencyX, callee.name.s)
# error correction, prevents endless for loop elimination in transf.
# See bug #2051:
result.sons[0] = newSymNode(errorSym(c, n))
if sfNoSideEffect notin callee.flags: if sfNoSideEffect notin callee.flags:
if {sfImportc, sfSideEffect} * callee.flags != {}: if {sfImportc, sfSideEffect} * callee.flags != {}:
incl(c.p.owner.flags, sfSideEffect) incl(c.p.owner.flags, sfSideEffect)

View file

@ -492,7 +492,8 @@ proc transformFor(c: PTransf, n: PNode): PTransNode =
var newC = newTransCon(getCurrOwner(c)) var newC = newTransCon(getCurrOwner(c))
newC.forStmt = n newC.forStmt = n
newC.forLoopBody = loopBody newC.forLoopBody = loopBody
internalAssert iter.kind == skIterator # this can fail for 'nimsuggest' and 'check':
if iter.kind != skIterator: return result
# generate access statements for the parameters (unless they are constant) # generate access statements for the parameters (unless they are constant)
pushTransCon(c, newC) pushTransCon(c, newC)
for i in countup(1, sonsLen(call) - 1): for i in countup(1, sonsLen(call) - 1):

View file

@ -735,14 +735,6 @@ regular expressions:
return tkUnknown return tkUnknown
Term rewriting macros
---------------------
Term rewriting macros can be used to enhance the compilation process
with user defined optimizations; see this `document <trmacros.html>`_ for
further information.
Building your first macro Building your first macro
------------------------- -------------------------

View file

@ -1455,7 +1455,8 @@ template `>%` *(x, y: expr): expr {.immediate.} = y <% x
proc `$`*(x: int): string {.magic: "IntToStr", noSideEffect.} proc `$`*(x: int): string {.magic: "IntToStr", noSideEffect.}
## The stringify operator for an integer argument. Returns `x` ## The stringify operator for an integer argument. Returns `x`
## converted to a decimal string. ## converted to a decimal string. ``$`` is Nim's general way of
## spelling `toString`:idx:.
proc `$`*(x: int64): string {.magic: "Int64ToStr", noSideEffect.} proc `$`*(x: int64): string {.magic: "Int64ToStr", noSideEffect.}
## The stringify operator for an integer argument. Returns `x` ## The stringify operator for an integer argument. Returns `x`

View file

@ -30,14 +30,16 @@ proc reprStrAux(result: var string, s: string) =
add result, "nil" add result, "nil"
return return
add result, reprPointer(cast[pointer](s)) & "\"" add result, reprPointer(cast[pointer](s)) & "\""
for c in items(s): for i in 0.. <s.len:
let c = s[i]
case c case c
of '"': add result, "\\\"" of '"': add result, "\\\""
of '\\': add result, "\\\\" # BUGFIX: forgotten of '\\': add result, "\\\\" # BUGFIX: forgotten
of '\10': add result, "\\10\"\n\"" # " \n " # better readability of '\10': add result, "\\10\"\n\"" # " \n " # better readability
of '\128' .. '\255', '\0'..'\9', '\11'..'\31': of '\128' .. '\255', '\0'..'\9', '\11'..'\31':
add result, "\\" & reprInt(ord(c)) add result, "\\" & reprInt(ord(c))
else: result.add(c) else:
result.add(c)
add result, "\"" add result, "\""
proc reprStr(s: string): string {.compilerRtl.} = proc reprStr(s: string): string {.compilerRtl.} =

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

BIN
web/assets/images/bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

View file

@ -8,7 +8,7 @@ body {
min-width:1030px; min-width:1030px;
margin:0; margin:0;
font:13pt "arial"; font:13pt "arial";
background:#152534 url("images/bg.jpg") no-repeat center top; background:#152534 url("images/bg.png") no-repeat center top;
color:rgba(0,0,0,.8); } color:rgba(0,0,0,.8); }
pre { pre {
@ -555,4 +555,4 @@ pre .end { background:url("images/tabEnd.png") no-repeat left bottom; }
#body table.docutils { #body table.docutils {
border-collapse: collapse; border-collapse: collapse;
text-align: left; text-align: left;
border-spacing: 0px; } border-spacing: 0px; }