Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
Merge pull request #30 from petems/move_contain_to_include_syntax
Browse files Browse the repository at this point in the history
Changes contain to be part of the include syntax
  • Loading branch information
Wliu authored and Wliu committed Mar 11, 2016
2 parents b3e8514 + 86ce372 commit 498e083
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions grammars/puppet.cson
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
'include': '#variable'
}
{
'begin': '(?i)\\b(import|include)\\b\\s*'
'begin': '(?i)\\b(import|include|contain)\\b\\s*'
'beginCaptures':
'1':
'name': 'keyword.control.import.include.puppet'
Expand All @@ -153,7 +153,7 @@
'name': 'constant.other.bareword.puppet'
}
{
'match': '(?i)\\b(alert|contain|crit|debug|defined|emerg|err|escape|fail|failed|file|generate|gsub|include|info|notice|package|realize|search|tag|tagged|template|warning)\\b'
'match': '(?i)\\b(alert|crit|debug|defined|emerg|err|escape|fail|failed|file|generate|gsub|info|notice|package|realize|search|tag|tagged|template|warning)\\b'
'name': 'support.function.puppet'
}
{
Expand Down
8 changes: 8 additions & 0 deletions spec/puppet-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,11 @@ describe "Puppet grammar", ->
it "tokenizes double quoted node", ->
{tokens} = grammar.tokenizeLine('node "hostname" {')
expect(tokens[0]).toEqual value: 'node', scopes: ['source.puppet', 'meta.definition.class.puppet', 'storage.type.puppet']

it "tokenizes include as an include function", ->
{tokens} = grammar.tokenizeLine("contain foo")
expect(tokens[0]).toEqual value: 'contain', scopes: ['source.puppet', 'meta.include.puppet', 'keyword.control.import.include.puppet']

it "tokenizes contain as an include function", ->
{tokens} = grammar.tokenizeLine('include foo')
expect(tokens[0]).toEqual value: 'include', scopes: ['source.puppet', 'meta.include.puppet', 'keyword.control.import.include.puppet']

0 comments on commit 498e083

Please sign in to comment.