summary refs log tree commit diff stats
path: root/compiler/parser.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2013-05-14 00:41:07 +0200
committerAraq <rumpf_a@web.de>2013-05-14 00:41:07 +0200
commit9b9a18094732ec88157a11d3845d626b8970bfb9 (patch)
tree54e47ed39c83c32224362e9bb73c18be9fdb95a9 /compiler/parser.nim
parent61b304832365d4d534628e002ac1e8620b19d94c (diff)
downloadNim-9b9a18094732ec88157a11d3845d626b8970bfb9.tar.gz
'inject' for 'for' loop variables
Diffstat (limited to 'compiler/parser.nim')
-rw-r--r--compiler/parser.nim10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/parser.nim b/compiler/parser.nim
index e2167f460..7cfd35a41 100644
--- a/compiler/parser.nim
+++ b/compiler/parser.nim
@@ -817,7 +817,7 @@ proc parseTuple(p: var TParser, indentAllowed = false): PNode =
           if not sameInd(p): break
 
 proc parseParamList(p: var TParser, retColon = true): PNode =
-  #| paramList = '(' identColonEquals ^* (comma/semicolon) ')'
+  #| paramList = '(' declColonEquals ^* (comma/semicolon) ')'
   #| paramListArrow = paramList? ('->' optInd typeDesc)?
   #| paramListColon = paramList? (':' optInd typeDesc)?
   var a: PNode
@@ -829,7 +829,7 @@ proc parseParamList(p: var TParser, retColon = true): PNode =
     while true:
       case p.tok.tokType
       of tkSymbol, tkAccent: 
-        a = parseIdentColonEquals(p, {withBothOptional})
+        a = parseIdentColonEquals(p, {withBothOptional, withPragma})
       of tkParRi: 
         break 
       else: 
@@ -1278,15 +1278,15 @@ proc parseExceptBlock(p: var TParser, kind: TNodeKind): PNode =
   addSon(result, parseStmt(p))
 
 proc parseFor(p: var TParser): PNode =
-  #| forStmt = 'for' symbol (comma symbol)* 'in' expr colcom stmt
+  #| forStmt = 'for' (identWithPragma ^+ comma) 'in' expr colcom stmt
   result = newNodeP(nkForStmt, p)
   getTokNoInd(p)
-  var a = parseSymbol(p)
+  var a = identWithPragma(p)
   addSon(result, a)
   while p.tok.tokType == tkComma:
     getTok(p)
     optInd(p, a)
-    a = parseSymbol(p)
+    a = identWithPragma(p)
     addSon(result, a)
   eat(p, tkIn)
   addSon(result, parseExpr(p))
3850ca'>^
a6f90d4cd ^
d2b45dbe8 ^
a6f90d4cd ^

a6f90d4cd ^




728328eec ^

a6f90d4cd ^









cd83cc81a ^

a6f90d4cd ^







dce8d3d1a ^

a6f90d4cd ^








a64f03230 ^



a6f90d4cd ^










a6f90d4cd ^




d2b45dbe8 ^

a6f90d4cd ^






d2b45dbe8 ^
a6f90d4cd ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128