From 2305dcfc2bc5d7486ca004e75ea0dc82b5705dcc Mon Sep 17 00:00:00 2001 From: Andy Li Date: Mon, 26 Nov 2012 16:47:40 +0800 Subject: Avoid referencing empty preproc_stack. --- pygments/lexers/web.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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() -- cgit v1.2.1