added warning for confusing var declarations

This commit is contained in:
Araq 2012-07-26 08:47:54 +02:00
commit 2ff8d17369
5 changed files with 19 additions and 7 deletions

View file

@ -244,7 +244,16 @@ proc transformConstSection(c: PTransf, v: PNode): PTransNode =
result[i] = PTransNode(b)
else:
result[i] = PTransNode(it)
proc trivialBody(s: PSym): PNode =
# a routine's body is trivially inlinable if marked as 'inline' and its
# body consists of only 1 statement. It is important that we perform this
# optimization here as 'distinct strings' may cause string copying otherwise:
# proc xml(s: string): TXmlString = return xmlstring(s)
# We have to generate a ``nkLineTracking`` node though to not lose
# debug information:
# XXX to implement
nil
proc hasContinue(n: PNode): bool =
case n.kind