From 1d2c88315ad84d71cf312b8e8e1cea79f68cc296 Mon Sep 17 00:00:00 2001 From: Tim Sharpe Date: Wed, 18 Apr 2012 13:17:33 -0700 Subject: [PATCH] Fixes for puppet lexer github/github#3474 --- vendor/custom_lexers/github.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vendor/custom_lexers/github.py b/vendor/custom_lexers/github.py index 839cf604..e596c474 100644 --- a/vendor/custom_lexers/github.py +++ b/vendor/custom_lexers/github.py @@ -112,6 +112,7 @@ class PuppetLexer(RegexLexer): ], 'puppet': [ include('comments'), + (r'(class)(\s*)(\{)', bygroups(Name.Class, Text, Punctuation), ('type', 'namevar')), (r'(class|define)', Keyword.Declaration, ('block','class_name')), (r'node', Keyword.Declaration, ('block', 'node_name')), (r'elsif', Keyword.Reserved, ('block', 'conditional')), @@ -124,7 +125,7 @@ class PuppetLexer(RegexLexer): (r'(::)?([A-Z][\w:]+)+(\s*)(\[)', bygroups(Name.Class, Name.Class, Text, Punctuation), ('type', 'override_name')), (r'(@{0,2}[\w:]+)(\s*)(\{)(\s*)', bygroups(Name.Class, Text, Punctuation, Text), ('type', 'namevar')), (r'\$(::)?(\w+::)*\w+', Name.Variable, 'var_assign'), - (r'include', Keyword.Namespace, 'include'), + (r'(include|require)', Keyword.Namespace, 'include'), (r'import', Keyword.Namespace, 'import'), (r'(\w+)(\()', bygroups(Name.Function, Punctuation), 'function'), (r'\s', Text), @@ -158,7 +159,7 @@ class PuppetLexer(RegexLexer): ], 'include': [ (r'\n', Text, '#pop'), - (r'[\w:]+', Name.Class), + (r'[\w:-]+', Name.Class), include('value'), (r'\s', Text), ],