Commits

Georg Brandl committed 8509791

Fix test suite: there are problems with groups being None.

  • Participants
  • Parent commits 1e3ffaf

Comments (0)

Files changed (2)

File pygments/lexers/text.py

              r'(\n[ \t]*\n)([ \t]+)(.*)(\n)((?:(?:\8.*|)\n)+)',
              _handle_sourcecode),
             # A directive
-            (r'^( *\.\.)(\s*)([\w-]+)(::)(?:([ \t]*)(.+))?',
+            (r'^( *\.\.)(\s*)([\w-]+)(::)(?:([ \t]*)(.*))',
              bygroups(Punctuation, Text, Operator.Word, Punctuation, Text,
                       using(this, state='inline'))),
             # A reference target
             (r'^( *\.\.)(\s*)(\[.+\])(.*?)$',
              bygroups(Punctuation, Text, Name.Tag, using(this, state='inline'))),
             # A substitution def
-            (r'^( *\.\.)(\s*)(\|.+\|)(\s*)([\w-]+)(::)(?:([ \t]*)(.+))$',
+            (r'^( *\.\.)(\s*)(\|.+\|)(\s*)([\w-]+)(::)(?:([ \t]*)(.*))',
              bygroups(Punctuation, Text, Name.Tag, Text, Operator.Word,
                       Punctuation, Text, using(this, state='inline'))),
             # Comments

File scripts/find_error.py

         statetokens = tokendefs[self.statestack[-1]]
         while 1:
             for rexmatch, action, new_state in statetokens:
-                self.m = rexmatch(text, self.pos)
-                if self.m:
+                self.m = m = rexmatch(text, self.pos)
+                if m:
                     if type(action) is _TokenType:
-                        yield self.pos, action, self.m.group()
+                        yield self.pos, action, m.group()
                     else:
-                        for item in action(self, self.m):
+                        for item in action(self, m):
                             yield item
-                    self.pos = self.m.end()
+                    self.pos = m.end()
                     if new_state is not None:
                         # state transition
                         if isinstance(new_state, tuple):