summaryrefslogtreecommitdiff
path: root/pygments/lexers/web.py
diff options
context:
space:
mode:
Diffstat (limited to 'pygments/lexers/web.py')
-rw-r--r--pygments/lexers/web.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pygments/lexers/web.py b/pygments/lexers/web.py
index 3b4ac872..a1bfbe59 100644
--- a/pygments/lexers/web.py
+++ b/pygments/lexers/web.py
@@ -1168,7 +1168,7 @@ class HaxeLexer(ExtendedRegexLexer):
self.preproc_stack.append(ctx.stack[:])
elif proc in ['else', 'elseif']:
# restore the stack back to right before #if
- ctx.stack = self.preproc_stack[-1]
+ if len(self.preproc_stack): ctx.stack = self.preproc_stack[-1]
elif proc == 'end':
# remove the saved stack of previous #if
if len(self.preproc_stack): self.preproc_stack.pop()