summary refs log tree commit diff stats
path: root/compiler/parser.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/parser.nim')
-rw-r--r--compiler/parser.nim6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/parser.nim b/compiler/parser.nim
index a91760e15..87565ae3a 100644
--- a/compiler/parser.nim
+++ b/compiler/parser.nim
@@ -1980,15 +1980,17 @@ proc parseTopLevelStmt(p: var TParser): PNode =
   ## top-level statement or emptyNode if end of stream.
   result = ast.emptyNode
   while true:
-    if p.tok.indent != 0: 
+    if p.tok.indent != 0:
       if p.firstTok and p.tok.indent < 0: discard
-      else: parMessage(p, errInvalidIndentation)
+      elif p.tok.tokType != tkSemiColon:
+        parMessage(p, errInvalidIndentation)
     p.firstTok = false
     case p.tok.tokType
     of tkSemiColon:
       getTok(p)
       if p.tok.indent <= 0: discard
       else: parMessage(p, errInvalidIndentation)
+      p.firstTok = true
     of tkEof: break
     else:
       result = complexOrSimpleStmt(p)
ply.github.com> 2022-07-14 08:20:40 -0400 committer GitHub <noreply@github.com> 2022-07-14 14:20:40 +0200 Change `styleCheck` to ignore foreign packages (#19822)' href='/ahoang/Nim/commit/compiler/linter.nim?h=devel&id=800cb006e74f8c52bde69cfc1eb9e55fcc439633'>800cb006e ^
5348fef00 ^







1a792d46d ^



6810a0e3e ^
2df9b442c ^




6810a0e3e ^



2df9b442c ^
1a792d46d ^

99078d80d ^
e844e536b ^

ceadf54d7 ^
1a792d46d ^

9605435f2 ^
6810a0e3e ^



fd2a80826 ^

2df9b442c ^
9605435f2 ^
6810a0e3e ^
6810a0e3e ^

8fd1ed6df ^


2df9b442c ^





9605435f2 ^
6810a0e3e ^
9605435f2 ^
6810a0e3e ^



bd689849f ^
e06046ab5 ^
13e659cfe ^


e06046ab5 ^





e844e536b ^
5348fef00 ^
5348fef00 ^

bd689849f ^
5348fef00 ^
800cb006e ^


70c25c45d ^
800cb006e ^


















b731e6ef1 ^
bd689849f ^






38bdf1cd7 ^
bd689849f ^



800cb006e ^
2df9b442c ^
a65189a73 ^

800cb006e ^












00b495de9 ^
bd689849f ^

800cb006e ^



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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152