Skip to content

Commit 07212bd

Browse files
committed
Add Binary type to lexer type tokens list
1 parent 167ab94 commit 07212bd

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/puppet-lint/lexer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def heredoc_queue
123123
[:WHITESPACE, %r{\A(#{WHITESPACE_RE}+)}],
124124
# FIXME: Future breaking change, the following :TYPE tokens conflict with
125125
# the :TYPE keyword token.
126-
[:TYPE, %r{\A(Any|Array|Boolean|Callable|CatalogEntry|Class|Collection|Data|Default|Enum|Error|Float|Hash|Integer|NotUndef|Numeric|Optional|Pattern|Regexp|Resource|Runtime|Scalar|Sensitive|String|Struct|Tuple|Type|Undef|Variant)\b}], # rubocop:disable Layout/LineLength
126+
[:TYPE, %r{\A(Any|Array|Binary|Boolean|Callable|CatalogEntry|Class|Collection|Data|Default|Enum|Error|Float|Hash|Integer|NotUndef|Numeric|Optional|Pattern|Regexp|Resource|Runtime|Scalar|Sensitive|String|Struct|Tuple|Type|Undef|Variant)\b}], # rubocop:disable Layout/LineLength
127127
[:CLASSREF, %r{\A(((::){0,1}[A-Z][-\w]*)+)}],
128128
[:NUMBER, %r{\A\b((?:0[xX][0-9A-Fa-f]+|0?\d+(?:\.\d+)?(?:[eE]-?\d+)?))\b}],
129129
[:FUNCTION_NAME, %r{#{NAME_RE}(?=\()}],

spec/unit/puppet-lint/lexer_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,6 +1396,12 @@
13961396
expect(token.type).to eq(:TYPE)
13971397
expect(token.value).to eq('Error')
13981398
end
1399+
1400+
it 'matches Binary type' do
1401+
token = lexer.tokenise('Binary').first
1402+
expect(token.type).to eq(:TYPE)
1403+
expect(token.value).to eq('Binary')
1404+
end
13991405
end
14001406

14011407
context ':HEREDOC without interpolation' do

0 commit comments

Comments
 (0)