diff options
author | gbrandl <devnull@localhost> | 2009-02-14 13:27:41 +0100 |
---|---|---|
committer | gbrandl <devnull@localhost> | 2009-02-14 13:27:41 +0100 |
commit | ececbbeaec4c3b87a9790bb60cc67809fedc5565 (patch) | |
tree | 8b40bbf71cdaba289c6dae2dc92a9432b07f68db | |
parent | 5ad29d59652da2ee8cb1e5d7674e5f3f1352ab96 (diff) | |
parent | 215dc40acfdb622e60e91989e3fb62d6846e6eba (diff) | |
download | pygments-ececbbeaec4c3b87a9790bb60cc67809fedc5565.tar.gz |
merge with tim
-rw-r--r-- | CHANGES | 22 | ||||
-rw-r--r-- | pygments/lexer.py | 1 | ||||
-rw-r--r-- | pygments/lexers/compiled.py | 17 |
3 files changed, 18 insertions, 22 deletions
@@ -18,27 +18,25 @@ Version 1.1 * MXML * Cython -- Added "anchorlinenos" option to HTML formatter. +- Add "anchorlinenos" option to HTML formatter. -- Fix a bug lexing extended Ruby strings. - -- Fix a bug when lexing git diffs. - -- Fix a bug in the JavaScript lexer (#383). +- Support multiline strings in Lua lexer. -- Fix a few problems in Matlab lexer (#378). +- When pygmentize is asked to highlight a file for which multiple lexers + match the filename, use the analyse_text guessing engine to determine the + winner (#355). -- Support multiline strings in Lua lexer. +- Fix minor bugs in the JavaScript lexer (#383), the Matlab lexer (#378), + the Scala lexer (#392), the INI lexer (#391), the Clojure lexer (#387) + and the AS3 lexer (#389). - Fix a Perl heredoc bug (#729). - Fix a bug in the image formatter which misdetected lines (#380). -- When pygmentize is asked to highlight a file for which multiple lexers - match the filename, use the analyse_text guessing engine to determine the - winner (#355). +- Fix a bug lexing extended Ruby strings. -- Fix minor bugs in Clojure lexer (#387), AS3 lexer (#389), INI lexer (#391) +- Fix a bug when lexing git diffs. Version 1.0 diff --git a/pygments/lexer.py b/pygments/lexer.py index 0e6f06bb..053df0fd 100644 --- a/pygments/lexer.py +++ b/pygments/lexer.py @@ -477,7 +477,6 @@ class RegexLexer(Lexer): for rexmatch, action, new_state in statetokens: m = rexmatch(text, pos) if m: - # print rex.pattern if type(action) is _TokenType: yield pos, action, m.group() else: diff --git a/pygments/lexers/compiled.py b/pygments/lexers/compiled.py index dbd1173b..f361de3a 100644 --- a/pygments/lexers/compiled.py +++ b/pygments/lexers/compiled.py @@ -992,23 +992,22 @@ class ScalaLexer(RegexLexer): (ur'%s|%s|`[^`]+`' % (idrest, op), Name.Class, '#pop'), ], 'type': [ - (r'(?<=\])(\s*$)', Text, '#pop'), - (r'[\s\n]+', Text), - (ur'<[%:]|=>|>:|[#_\u21D2]|forSome|type', Keyword), - (r'([,\);}]|=(?!>))([\s\n]*)', bygroups(Operator, Text), '#pop'), + (r'\s+', Text), + (ur'<[%:]|>:|[#_\u21D2]|forSome|type', Keyword), + (r'([,\);}]|=>|=)([\s\n]*)', bygroups(Operator, Text), '#pop'), (r'[\(\{]', Operator, '#push'), - (ur'((?:\.|%s|%s|`[^`]+`)+)([\s]*)(\[)' % (idrest, op), - bygroups(Keyword.Type, Text, Operator), 'typeparam'), - (ur'((?:\.|%s|%s|`[^`]+`)+)(\s*)$' % (idrest, op), + (ur'((?:%s|%s|`[^`]+`)(?:\.(?:%s|%s|`[^`]+`))*)(\s*)(\[)' % (idrest, op, idrest, op), + bygroups(Keyword.Type, Text, Operator), ('#pop', 'typeparam')), + (ur'((?:%s|%s|`[^`]+`)(?:\.(?:%s|%s|`[^`]+`))*)(\s*)$' % (idrest, op, idrest, op), bygroups(Keyword.Type, Text), '#pop'), - (ur'(\.|%s|%s|`[^`]+`)+' % (idrest, op), Keyword.Type) + (ur'\.|%s|%s|`[^`]+`' % (idrest, op), Keyword.Type) ], 'typeparam': [ (r'[\s\n,]+', Text), (ur'<[%:]|=>|>:|[#_\u21D2]|forSome|type', Keyword), (r'([\]\)\}])', Operator, '#pop'), (r'[\(\[\{]', Operator, '#push'), - (ur'(\.|%s|%s|`[^`]+`)+' % (idrest, op), Keyword.Type) + (ur'\.|%s|%s|`[^`]+`' % (idrest, op), Keyword.Type) ], 'comment': [ (r'[^/\*]+', Comment.Multiline), |