summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles McLaughlin <mclaughlinct@gmail.com>2012-11-25 21:25:24 -0800
committerCharles McLaughlin <mclaughlinct@gmail.com>2012-11-25 21:25:24 -0800
commit0f970740661dabc7861db9e63c8e953df054ef19 (patch)
tree02b88303d796fdfdcbbc58c75160b14a54fbb53c
parentbe3318e384f0eb88f4160a0b2076960becd36148 (diff)
downloadpygments-0f970740661dabc7861db9e63c8e953df054ef19.tar.gz
work around non-quoted strings with embedded keywords such as role-production
-rw-r--r--pygments/lexers/puppet.py57
1 files changed, 30 insertions, 27 deletions
diff --git a/pygments/lexers/puppet.py b/pygments/lexers/puppet.py
index a647dc92..fefdb549 100644
--- a/pygments/lexers/puppet.py
+++ b/pygments/lexers/puppet.py
@@ -63,33 +63,36 @@ class PuppetLexer(RegexLexer):
],
'keywords': [
- # Left out 'group' and 'require' as they are used as attributes
- (r'(?i)(absent|alert|alias|audit|augeas|before|case)\b', Keyword),
- (r'(?i)(check|class|computer|configured|contained)\b', Keyword),
- (r'(?i)(create_resources|crit|cron|debug|default)\b', Keyword),
- (r'(?i)(define|defined|directory|else|elsif|emerg)\b', Keyword),
- (r'(?i)(err|exec|extlookup|fail|false|file)\b', Keyword),
- (r'(?i)(filebucket|fqdn_rand|generate|host|if|import)\b', Keyword),
- (r'(?i)(include|info|inherits|inline_template)\b', Keyword),
- (r'(?i)(installed|interface|k5login|latest|link)\b', Keyword),
- (r'(?i)(loglevel|macauthorization|mailalias|maillist)\b', Keyword),
- (r'(?i)(mcx|md5|mount|mounted|nagios_command)\b', Keyword),
- (r'(?i)(nagios_contact|nagios_contactgroup)\b', Keyword),
- (r'(?i)(nagios_host|nagios_hostdependency)\b', Keyword),
- (r'(?i)(nagios_hostescalation|nagios_hostextinfo)\b', Keyword),
- (r'(?i)(nagios_hostgroup|nagios_service)\b', Keyword),
- (r'(?i)(nagios_servicedependency)\b', Keyword),
- (r'(?i)(nagios_serviceescalation)\b', Keyword),
- (r'(?i)(nagios_serviceextinfo|nagios_servicegroup)\b', Keyword),
- (r'(?i)(nagios_timeperiod|node|noop|notice|notify)\b', Keyword),
- (r'(?i)(package|present|purged|realize|regsubst)\b', Keyword),
- (r'(?i)(resources|role|router|running)\b', Keyword),
- (r'(?i)(schedule|scheduled_task|search|selboolean)\b', Keyword),
- (r'(?i)(selmodule|service|sha1|shellquote|split)\b', Keyword),
- (r'(?i)(sprintf|ssh_authorized_key|sshkey|stage)\b', Keyword),
- (r'(?i)(stopped|subscribe|tag|tagged|template|tidy)\b', Keyword),
- (r'(?i)(true|undef|unmounted|user|versioncmp|vlan)\b', Keyword),
- (r'(?i)(warning|yumrepo|zfs|zone|zpool)\b', Keyword),
+ # Left out 'group' and 'require'
+ # Since they're often used as attributes
+ (r'(?i)\s(absent|alert|alias|audit|augeas|before)\s', Keyword),
+ (r'(?i)\s(case|check|class|computer|configured)\s', Keyword),
+ (r'(?i)\s(contained|create_resources|crit|cron)\s', Keyword),
+ (r'(?i)\s(debug|default|define|defined|directory)\s', Keyword),
+ (r'(?i)\s(else|elsif|emerg|err|exec|extlookup)\s', Keyword),
+ (r'(?i)\s(fail|false|file|filebucket|fqdn_rand)\s', Keyword),
+ (r'(?i)\s(generate|host|if|import|include|info)\s', Keyword),
+ (r'(?i)\s(inherits|inline_template|installed)\s', Keyword),
+ (r'(?i)\s(interface|k5login|latest|link|loglevel)\s', Keyword),
+ (r'(?i)\s(macauthorization|mailalias|maillist)\s', Keyword),
+ (r'(?i)\s(mcx|md5|mount|mounted|nagios_command)\s', Keyword),
+ (r'(?i)\s(nagios_contact|nagios_contactgroup)\s', Keyword),
+ (r'(?i)\s(nagios_host|nagios_hostdependency)\s', Keyword),
+ (r'(?i)\s(nagios_hostescalation|nagios_hostextinfo)\s', Keyword),
+ (r'(?i)\s(nagios_hostgroup|nagios_service)\s', Keyword),
+ (r'(?i)\s(nagios_servicedependency)\s', Keyword),
+ (r'(?i)\s(nagios_serviceescalation)\s', Keyword),
+ (r'(?i)\s(nagios_serviceextinfo)\s', Keyword),
+ (r'(?i)\s(nagios_servicegroup|nagios_timeperiod)\s', Keyword),
+ (r'(?i)\s(node|noop|notice|notify)\s', Keyword),
+ (r'(?i)\s(package|present|purged|realize|regsubst)\s', Keyword),
+ (r'(?i)\s(resources|role|router|running)\s', Keyword),
+ (r'(?i)\s(schedule|scheduled_task|search|selboolean)\s', Keyword),
+ (r'(?i)\s(selmodule|service|sha1|shellquote|split)\s', Keyword),
+ (r'(?i)\s(sprintf|ssh_authorized_key|sshkey|stage)\s', Keyword),
+ (r'(?i)\s(stopped|subscribe|tag|tagged|template|tidy)\s', Keyword),
+ (r'(?i)\s(true|undef|unmounted|user|versioncmp|vlan)\s', Keyword),
+ (r'(?i)\s(warning|yumrepo|zfs|zone|zpool)\s', Keyword),
],
'strings': [