diff options
author | gbrandl <devnull@localhost> | 2006-10-30 09:20:46 +0100 |
---|---|---|
committer | gbrandl <devnull@localhost> | 2006-10-30 09:20:46 +0100 |
commit | 1c4e080bb82d27c914a763ae9ef0667dcc6031c1 (patch) | |
tree | 7efb34f06e87962c258cff23e97f9a27854b7b93 | |
parent | 774af50b54d2ada20167b8b11a63d077b41ca5a9 (diff) | |
download | pygments-1c4e080bb82d27c914a763ae9ef0667dcc6031c1.tar.gz |
[svn] Fix an error in GenshiTextLexer and DelegatingLexer.
-rw-r--r-- | pygments/lexer.py | 3 | ||||
-rw-r--r-- | pygments/lexers/templates.py | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/pygments/lexer.py b/pygments/lexer.py index 28c5c825..51bacdbd 100644 --- a/pygments/lexer.py +++ b/pygments/lexer.py @@ -153,7 +153,8 @@ class DelegatingLexer(Lexer): buffered += v else: lng_buffer.append((i, t, v)) - # the last "\n" should always be lexed by the root lexer + if lng_buffer: + insertions.append((len(buffered), lng_buffer)) return do_insertions(insertions, self.root_lexer.get_tokens_unprocessed(buffered)) diff --git a/pygments/lexers/templates.py b/pygments/lexers/templates.py index 666bd5a7..641675b9 100644 --- a/pygments/lexers/templates.py +++ b/pygments/lexers/templates.py @@ -230,11 +230,11 @@ class GenshiTextLexer(RegexLexer): tokens = { 'root': [ - (r'[^#\$\s]+', Text), + (r'[^#\$\s]+', Other), (r'^(\s*)(##.*)$', bygroups(Text, Comment)), (r'^(\s*)(#)', bygroups(Text, Comment.Preproc), 'directive'), include('variable'), - (r'[#\$\s]', Text), + (r'[#\$\s]', Other), ], 'directive': [ (r'\n', Text, '#pop'), |