diff pygments_lexer_pseudocode2/bases.py @ 83:cd79d2c76347

If a Pygments callback gets a "Context" it must set the new position explicitely. This is **not** done automatically.
author Franz Glasner <fzglas.hg@dom66.de>
date Thu, 30 Apr 2026 13:21:38 +0200
parents a2a56d08b860
children e1663ac707b0
line wrap: on
line diff
--- a/pygments_lexer_pseudocode2/bases.py	Thu Apr 30 12:29:08 2026 +0200
+++ b/pygments_lexer_pseudocode2/bases.py	Thu Apr 30 13:21:38 2026 +0200
@@ -85,6 +85,8 @@
         """Unconditionally ignore the match."""
         if False:
             yield match.start(), Other, ""
+        if ctx:
+            ctx.pos = match.end()
 
     @_staticmethod
     def op_fixed(toktype, value):
@@ -92,6 +94,8 @@
 
         def _op_fixed(lexer, match, ctx=None):
             yield match.start(), toktype, value
+            if ctx:
+                ctx.pos = match.end()
 
         return _op_fixed