diff options
author | Tim Hatch <tim@timhatch.com> | 2012-12-24 10:22:26 -0800 |
---|---|---|
committer | Tim Hatch <tim@timhatch.com> | 2012-12-24 10:22:26 -0800 |
commit | a5861cb934ab3b90517a1bf2383ba1ce50247e3d (patch) | |
tree | 713930b55006228d70d875314a340a04e3fe0a6e | |
parent | 45359c6914c0bbaf9fbd2f03477b73ff452266c0 (diff) | |
download | pygments-a5861cb934ab3b90517a1bf2383ba1ce50247e3d.tar.gz |
Remove inline-if syntax from robot lexer, restoring Python 2.4 compatibility.
Fixes #830
-rw-r--r-- | pygments/lexers/_robotframeworklexer.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pygments/lexers/_robotframeworklexer.py b/pygments/lexers/_robotframeworklexer.py index f5b30489..f3b5f223 100644 --- a/pygments/lexers/_robotframeworklexer.py +++ b/pygments/lexers/_robotframeworklexer.py @@ -150,8 +150,8 @@ class RowSplitter(object): _pipe_splitter = re.compile('((?:^| +)\|(?: +|$))') def split(self, row): - splitter = self._split_from_spaces \ - if not row.startswith('| ') else self._split_from_pipes + splitter = (row.startswith('| ') and self._split_from_pipes + or self._split_from_spaces) for value in splitter(row.rstrip()): yield value yield '\n' @@ -300,7 +300,7 @@ class ForLoop(Tokenizer): self._in_arguments = False def _tokenize(self, value, index): - token = ARGUMENT if self._in_arguments else SYNTAX + token = self._in_arguments and ARGUMENT or SYNTAX if value.upper() in ('IN', 'IN RANGE'): self._in_arguments = True return token |