diff options
author | Andy Li <andy@onthewings.net> | 2012-11-26 16:47:40 +0800 |
---|---|---|
committer | Andy Li <andy@onthewings.net> | 2012-11-26 16:47:40 +0800 |
commit | 2305dcfc2bc5d7486ca004e75ea0dc82b5705dcc (patch) | |
tree | 5cd061913a9689d0125228df4ededce777ca1030 | |
parent | fafddd8fe418a973b75210719a53b9aadcbd9734 (diff) | |
download | pygments-2305dcfc2bc5d7486ca004e75ea0dc82b5705dcc.tar.gz |
Avoid referencing empty preproc_stack.
-rw-r--r-- | pygments/lexers/web.py | 2 |
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() |