summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Li <andy@onthewings.net>2012-11-26 16:47:40 +0800
committerAndy Li <andy@onthewings.net>2012-11-26 16:47:40 +0800
commit2305dcfc2bc5d7486ca004e75ea0dc82b5705dcc (patch)
tree5cd061913a9689d0125228df4ededce777ca1030
parentfafddd8fe418a973b75210719a53b9aadcbd9734 (diff)
downloadpygments-2305dcfc2bc5d7486ca004e75ea0dc82b5705dcc.tar.gz
Avoid referencing empty preproc_stack.
-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()