summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pygments/lexers/text.py4
-rwxr-xr-xscripts/find_error.py10
2 files changed, 7 insertions, 7 deletions
diff --git a/pygments/lexers/text.py b/pygments/lexers/text.py
index 8fd57bc5..2a361a95 100644
--- a/pygments/lexers/text.py
+++ b/pygments/lexers/text.py
@@ -663,7 +663,7 @@ class RstLexer(RegexLexer):
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
@@ -673,7 +673,7 @@ class RstLexer(RegexLexer):
(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
diff --git a/scripts/find_error.py b/scripts/find_error.py
index 82a74de0..ebaa1d41 100755
--- a/scripts/find_error.py
+++ b/scripts/find_error.py
@@ -41,14 +41,14 @@ class DebuggingRegexLexer(RegexLexer):
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):