Merge ../Nim into devel
This commit is contained in:
commit
6206795464
4 changed files with 22 additions and 1 deletions
|
|
@ -48,7 +48,7 @@ proc genVarTuple(p: BProc, n: PNode) =
|
||||||
return
|
return
|
||||||
genLineDir(p, n)
|
genLineDir(p, n)
|
||||||
initLocExpr(p, n.sons[L-1], tup)
|
initLocExpr(p, n.sons[L-1], tup)
|
||||||
var t = tup.t
|
var t = tup.t.getUniqueType
|
||||||
for i in countup(0, L-3):
|
for i in countup(0, L-3):
|
||||||
var v = n.sons[i].sym
|
var v = n.sons[i].sym
|
||||||
if sfCompileTime in v.flags: continue
|
if sfCompileTime in v.flags: continue
|
||||||
|
|
|
||||||
|
|
@ -1597,6 +1597,7 @@ proc parseEnum(p: var TParser): PNode =
|
||||||
optInd(p, result)
|
optInd(p, result)
|
||||||
while true:
|
while true:
|
||||||
var a = parseSymbol(p)
|
var a = parseSymbol(p)
|
||||||
|
if a.kind == nkEmpty: return
|
||||||
if p.tok.indent >= 0 and p.tok.indent <= p.currInd:
|
if p.tok.indent >= 0 and p.tok.indent <= p.currInd:
|
||||||
add(result, a)
|
add(result, a)
|
||||||
break
|
break
|
||||||
|
|
|
||||||
11
tests/parser/twhen_in_enum.nim
Normal file
11
tests/parser/twhen_in_enum.nim
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
discard """
|
||||||
|
errormsg: "identifier expected, but found 'keyword when'"
|
||||||
|
"""
|
||||||
|
|
||||||
|
# bug #2123
|
||||||
|
type num = enum
|
||||||
|
NUM_NONE = 0
|
||||||
|
NUM_ALL = 1
|
||||||
|
when defined(macosx): NUM_OSX = 10 # only this differs for real
|
||||||
|
NUM_XTRA = 20
|
||||||
|
|
||||||
9
tests/tuples/tgeneric_tuple.nim
Normal file
9
tests/tuples/tgeneric_tuple.nim
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
# bug #2121
|
||||||
|
|
||||||
|
type
|
||||||
|
Item[K,V] = tuple
|
||||||
|
key: K
|
||||||
|
value: V
|
||||||
|
|
||||||
|
var q = newseq[Item[int,int]](0)
|
||||||
|
let (x,y) = q[0]
|
||||||
Loading…
Add table
Add a link
Reference in a new issue