mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-06 11:54:11 +00:00
fixes #100
This commit is contained in:
@@ -87,7 +87,7 @@ proc semSym(c: PContext, n: PNode, s: PSym, flags: TExprFlags): PNode =
|
||||
result = newSymNode(s, n.info)
|
||||
of skMacro: result = semMacroExpr(c, n, s)
|
||||
of skTemplate: result = semTemplateExpr(c, n, s)
|
||||
of skVar, skLet, skResult, skParam:
|
||||
of skVar, skLet, skResult, skParam, skForVar:
|
||||
markUsed(n, s)
|
||||
# if a proc accesses a global variable, it is not side effect free:
|
||||
if sfGlobal in s.flags:
|
||||
|
||||
@@ -407,6 +407,7 @@ proc semForVars(c: PContext, n: PNode): PNode =
|
||||
if iter.kind != tyTuple or length == 3:
|
||||
if length != 3: GlobalError(n.info, errWrongNumberOfVariables)
|
||||
var v = newSymS(skForVar, n.sons[0], c)
|
||||
if getCurrOwner().kind == skModule: incl(v.flags, sfGlobal)
|
||||
# BUGFIX: don't use `iter` here as that would strip away
|
||||
# the ``tyGenericInst``! See ``tests/compile/tgeneric.nim``
|
||||
# for an example:
|
||||
@@ -418,6 +419,7 @@ proc semForVars(c: PContext, n: PNode): PNode =
|
||||
GlobalError(n.info, errWrongNumberOfVariables)
|
||||
for i in countup(0, length - 3):
|
||||
var v = newSymS(skForVar, n.sons[i], c)
|
||||
if getCurrOwner().kind == skModule: incl(v.flags, sfGlobal)
|
||||
v.typ = iter.sons[i]
|
||||
n.sons[i] = newSymNode(v)
|
||||
addDecl(c, v)
|
||||
|
||||
16
todo.txt
16
todo.txt
@@ -19,7 +19,8 @@ version 0.9.0
|
||||
- implement the high level optimizer
|
||||
- change overloading resolution
|
||||
- implement proper coroutines
|
||||
- implement ``partial`` pragma for partial evaluation
|
||||
- implement ``partial`` pragma for partial evaluation; ``hoist`` pragma for
|
||||
loop hoisting
|
||||
- we need to support iteration of 2 different data structures in parallel
|
||||
- make exceptions compatible with C++ exceptions
|
||||
- 'const' objects including case objects
|
||||
@@ -28,6 +29,12 @@ version 0.9.0
|
||||
changes that people want; may turn out to be a bad idea
|
||||
- activate more thread tests
|
||||
- optimize method dispatchers
|
||||
- rethink the syntax: distinction between expr and stmt is unfortunate;
|
||||
indentation handling is quite complex too; problem with exception handling
|
||||
is that often the scope of ``try`` is wrong and apart from that ``try`` is
|
||||
a full blown statement; a ``try`` expression might be a good idea to make
|
||||
error handling more light-weight
|
||||
people also want ``inc a; inc b``
|
||||
|
||||
Bugs
|
||||
----
|
||||
@@ -168,11 +175,4 @@ Version 2
|
||||
a generalized case statement looks like:
|
||||
|
||||
case x with `=~`
|
||||
|
||||
- rethink the syntax: distinction between expr and stmt is unfortunate;
|
||||
indentation handling is quite complex too; problem with exception handling
|
||||
is that often the scope of ``try`` is wrong and apart from that ``try`` is
|
||||
a full blown statement; a ``try`` expression might be a good idea to make
|
||||
error handling more light-weight
|
||||
people also want ``inc a; inc b``
|
||||
|
||||
|
||||
Reference in New Issue
Block a user