summaryrefslogtreecommitdiff
path: root/pygments/lexers/scripting.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2014-09-19 17:17:59 +0200
committerGeorg Brandl <georg@python.org>2014-09-19 17:17:59 +0200
commit35bb72a4734b52beeddf0d9d27c98ee675742223 (patch)
tree98dc3125085aeac07403fd1e7e3ff18aa50694e2 /pygments/lexers/scripting.py
parentee30ccc917dd4e811514a07adb7c940bdd1564f4 (diff)
downloadpygments-35bb72a4734b52beeddf0d9d27c98ee675742223.tar.gz
More application of words().
Diffstat (limited to 'pygments/lexers/scripting.py')
-rw-r--r--pygments/lexers/scripting.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/pygments/lexers/scripting.py b/pygments/lexers/scripting.py
index d5ec2405..2d8a58a4 100644
--- a/pygments/lexers/scripting.py
+++ b/pygments/lexers/scripting.py
@@ -11,7 +11,8 @@
import re
-from pygments.lexer import RegexLexer, include, bygroups, default, combined
+from pygments.lexer import RegexLexer, include, bygroups, default, combined, \
+ words
from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
Number, Punctuation
from pygments.util import get_bool_opt, get_list_opt, iteritems
@@ -174,9 +175,12 @@ class MoonScriptLexer(LuaLexer):
(r'[;,]', Punctuation),
(r'[\[\]\{\}\(\)]', Keyword.Type),
(r'[a-zA-Z_]\w*:', Name.Variable),
- (r"(class|extends|if|then|super|do|with|import|export|"
- r"while|elseif|return|for|in|from|when|using|else|"
- r"and|or|not|switch|break)\b", Keyword),
+ (words((
+ 'class', 'extends', 'if', 'then', 'super', 'do', 'with',
+ 'import', 'export', 'while', 'elseif', 'return', 'for', 'in',
+ 'from', 'when', 'using', 'else', 'and', 'or', 'not', 'switch',
+ 'break'), suffix=r'\b'),
+ Keyword),
(r'(true|false|nil)\b', Keyword.Constant),
(r'(and|or|not)\b', Operator.Word),
(r'(self)\b', Name.Builtin.Pseudo),