eric6/ThirdParty/Pygments/pygments/lexers/webmisc.py

changeset 7547
21b0534faebc
parent 6942
2602857055c5
child 7701
25f42e208e08
diff -r bf5f777260a6 -r 21b0534faebc eric6/ThirdParty/Pygments/pygments/lexers/webmisc.py
--- a/eric6/ThirdParty/Pygments/pygments/lexers/webmisc.py	Tue Apr 21 19:44:19 2020 +0200
+++ b/eric6/ThirdParty/Pygments/pygments/lexers/webmisc.py	Tue Apr 21 19:47:10 2020 +0200
@@ -5,7 +5,7 @@
 
     Lexers for misc. web stuff.
 
-    :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -158,6 +158,9 @@
         # state stack
         if len(lexer.xquery_parse_state) == 0:
             ctx.stack.pop()
+            if not ctx.stack:
+                # make sure we have at least the root state on invalid inputs
+                ctx.stack = ['root']
         elif len(ctx.stack) > 1:
             ctx.stack.append(lexer.xquery_parse_state.pop())
         else:

eric ide

mercurial