hcl-checker 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/assets/lexer.rex +7 -0
- data/lib/hcl/checker/version.rb +1 -1
- data/lib/hcl/lexer.rb +8 -0
- data/lib/hcl/parser.rb +14 -14
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b2ea8567305e0dfa10761345da6129798b1cdc2
|
4
|
+
data.tar.gz: 5c31f865563f0268cd288e8a73fb37fd2dff8d49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4fdaf59be28ffa057a8c297e8d17c46829c0d14abd5ac2ad5ca2c40ad65349497005108b4fb11eef38ee9fa7777d3710c5ba44c7b697cc44736ead30a321ddf
|
7
|
+
data.tar.gz: 36c6ec52a33950523ff3d9af72e1993a4aa20334a51b58ef83d6aceaf9d94d9d90480662ec3c1254c5be015fd3e646597334ef7969dc847bbfe39b4f3b161784
|
data/Gemfile.lock
CHANGED
data/assets/lexer.rex
CHANGED
@@ -20,6 +20,7 @@ macro
|
|
20
20
|
RIGHTBRACE \}
|
21
21
|
LEFTBRACKET \[
|
22
22
|
RIGHTBRACKET \]
|
23
|
+
HEREDOCUMENT \<<-
|
23
24
|
|
24
25
|
rule
|
25
26
|
# [:state] pattern [actions]
|
@@ -33,6 +34,7 @@ rule
|
|
33
34
|
{NUMBER} { [:NUMBER, text.to_i] }
|
34
35
|
{FLOAT} { [:FLOAT, text.to_f] }
|
35
36
|
{QUOTE} { [:STRING, consume_string(text)] }
|
37
|
+
{HEREDOCUMENT} { [:STRING, consume_heredoc] }
|
36
38
|
#-------------------------------------------------------------------------------
|
37
39
|
{LEFTBRACE} { [:LEFTBRACE, text]}
|
38
40
|
{RIGHTBRACE} { [:RIGHTBRACE, text]}
|
@@ -105,5 +107,10 @@ inner
|
|
105
107
|
result.chop
|
106
108
|
end
|
107
109
|
|
110
|
+
def consume_heredoc
|
111
|
+
token = Regexp.new @ss.scan_until(%r{\n})
|
112
|
+
document = @ss.scan_until(token)
|
108
113
|
|
114
|
+
document.chop
|
115
|
+
end
|
109
116
|
end
|
data/lib/hcl/checker/version.rb
CHANGED
data/lib/hcl/lexer.rb
CHANGED
@@ -81,6 +81,9 @@ class HCLLexer
|
|
81
81
|
when (text = @ss.scan(/\"/))
|
82
82
|
action { [:STRING, consume_string(text)] }
|
83
83
|
|
84
|
+
when (text = @ss.scan(/\<<-/))
|
85
|
+
action { [:STRING, consume_heredoc] }
|
86
|
+
|
84
87
|
when (text = @ss.scan(/\{/))
|
85
88
|
action { [:LEFTBRACE, text]}
|
86
89
|
|
@@ -163,4 +166,9 @@ class HCLLexer
|
|
163
166
|
end until nested == 0 && text =~ %r{\"\z}
|
164
167
|
result.chop
|
165
168
|
end
|
169
|
+
def consume_heredoc
|
170
|
+
token = Regexp.new @ss.scan_until(%r{\n})
|
171
|
+
document = @ss.scan_until(token)
|
172
|
+
document.chop
|
173
|
+
end
|
166
174
|
end # class
|
data/lib/hcl/parser.rb
CHANGED
@@ -70,19 +70,19 @@ module_eval(<<'...end parse.y/module_eval...', 'parse.y', 115)
|
|
70
70
|
|
71
71
|
racc_action_table = [
|
72
72
|
20, 26, 25, 36, 26, 25, 5, 21, 6, 13,
|
73
|
-
33, 24, 35, 26, 25, 30, 5,
|
74
|
-
5, 28, 6,
|
75
|
-
-9,
|
73
|
+
33, 24, 35, 26, 25, 30, 5, 10, 6, 33,
|
74
|
+
5, 28, 6, -8, 16, 34, 17, 5, 13, 6,
|
75
|
+
-9, 12, 18 ]
|
76
76
|
|
77
77
|
racc_action_check = [
|
78
78
|
12, 12, 12, 29, 24, 24, 0, 12, 0, 12,
|
79
|
-
24, 12, 29, 36, 36, 24, 13,
|
80
|
-
27, 13, 27,
|
81
|
-
6,
|
79
|
+
24, 12, 29, 36, 36, 24, 13, 1, 13, 36,
|
80
|
+
27, 13, 27, 5, 9, 27, 9, 3, 9, 3,
|
81
|
+
6, 7, 10 ]
|
82
82
|
|
83
83
|
racc_action_pointer = [
|
84
|
-
-1,
|
85
|
-
|
84
|
+
-1, 17, nil, 20, nil, 15, 22, 23, nil, 17,
|
85
|
+
32, nil, -2, 9, nil, nil, nil, nil, nil, nil,
|
86
86
|
nil, nil, nil, nil, 1, nil, nil, 13, nil, -2,
|
87
87
|
nil, nil, nil, nil, nil, nil, 10, nil ]
|
88
88
|
|
@@ -93,18 +93,18 @@ racc_action_default = [
|
|
93
93
|
-21, -22, -25, -26, -6, -20, -24, -23 ]
|
94
94
|
|
95
95
|
racc_goto_table = [
|
96
|
-
11, 3, 14, 31,
|
97
|
-
|
96
|
+
11, 3, 14, 31, 1, 22, 2, 19, 23, 15,
|
97
|
+
29, nil, nil, nil, 27, 37, nil, nil, nil, nil,
|
98
98
|
nil, nil, nil, nil, 11 ]
|
99
99
|
|
100
100
|
racc_goto_check = [
|
101
|
-
4, 3, 5, 12,
|
102
|
-
|
101
|
+
4, 3, 5, 12, 1, 5, 2, 7, 8, 9,
|
102
|
+
11, nil, nil, nil, 3, 12, nil, nil, nil, nil,
|
103
103
|
nil, nil, nil, nil, 4 ]
|
104
104
|
|
105
105
|
racc_goto_pointer = [
|
106
|
-
nil,
|
107
|
-
nil, -
|
106
|
+
nil, 4, 6, 1, -3, -7, nil, -5, -4, 0,
|
107
|
+
nil, -14, -21 ]
|
108
108
|
|
109
109
|
racc_goto_default = [
|
110
110
|
nil, nil, nil, nil, 4, nil, 7, 32, nil, 8,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hcl-checker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcelo Castellani
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-02-
|
11
|
+
date: 2018-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|