Skip to content

Commit ef12979

Browse files
committed
lexer: use multiple lines for the data type list
Using Regexp's Extended Mode (the `x` modifier).
1 parent 0e8feb3 commit ef12979

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

lib/puppet-lint/lexer.rb

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,38 @@ 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|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
126+
[:TYPE, %r{\A(
127+
Any|
128+
Array|
129+
Binary|
130+
Boolean|
131+
Callable|
132+
CatalogEntry|
133+
Class|
134+
Collection|
135+
Data|
136+
Default|
137+
Enum|
138+
Error|
139+
Float|
140+
Hash|
141+
Integer|
142+
NotUndef|
143+
Numeric|
144+
Optional|
145+
Pattern|
146+
Regexp|
147+
Resource|
148+
Runtime|
149+
Scalar|
150+
Sensitive|
151+
String|
152+
Struct|
153+
Tuple|
154+
Type|
155+
Undef|
156+
Variant
157+
)\b}x],
127158
[:CLASSREF, %r{\A(((::){0,1}[A-Z][-\w]*)+)}],
128159
[:NUMBER, %r{\A\b((?:0[xX][0-9A-Fa-f]+|0?\d+(?:\.\d+)?(?:[eE]-?\d+)?))\b}],
129160
[:FUNCTION_NAME, %r{#{NAME_RE}(?=\()}],

0 commit comments

Comments
 (0)