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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6a2309b01f23b368550a522feb4f471ffdc8c5a1
4
- data.tar.gz: 78bc04971429a55471fe1e54340b1d1c41d33975
3
+ metadata.gz: 8b2ea8567305e0dfa10761345da6129798b1cdc2
4
+ data.tar.gz: 5c31f865563f0268cd288e8a73fb37fd2dff8d49
5
5
  SHA512:
6
- metadata.gz: 2334da101edb93a3b5977da2ffc5a63320887a5247b47f453699427802449fe7c51248d73d6bf5358255889a09eedb39e924566ac36a677b7c22e500d976fadd
7
- data.tar.gz: 57782ba047e143929e3f065e5f77b7a798f71492d02075866f1e43f837b19f3682215c446a61a71dad9038bd14251d1dc857ccb3ad2204cf691f2a8e78552e2c
6
+ metadata.gz: c4fdaf59be28ffa057a8c297e8d17c46829c0d14abd5ac2ad5ca2c40ad65349497005108b4fb11eef38ee9fa7777d3710c5ba44c7b697cc44736ead30a321ddf
7
+ data.tar.gz: 36c6ec52a33950523ff3d9af72e1993a4aa20334a51b58ef83d6aceaf9d94d9d90480662ec3c1254c5be015fd3e646597334ef7969dc847bbfe39b4f3b161784
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hcl-checker (1.0.4)
4
+ hcl-checker (1.0.5)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
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
@@ -1,5 +1,5 @@
1
1
  module HCL
2
2
  module Checker
3
- VERSION = '1.0.4'
3
+ VERSION = '1.0.5'
4
4
  end
5
5
  end
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, 18, 6, 33,
74
- 5, 28, 6, 12, 16, 34, 17, 5, 13, 6,
75
- -9, -8, 10 ]
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, 10, 13, 36,
80
- 27, 13, 27, 7, 9, 27, 9, 3, 9, 3,
81
- 6, 5, 1 ]
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, 32, nil, 20, nil, 23, 22, 15, nil, 17,
85
- 17, nil, -2, 9, nil, nil, nil, nil, nil, nil,
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, 15, 22, 29, 19, 2, 1,
97
- 23, nil, nil, nil, 27, 37, nil, nil, nil, nil,
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, 9, 5, 11, 7, 2, 1,
102
- 8, nil, nil, nil, 3, 12, nil, nil, nil, nil,
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, 9, 8, 1, -3, -7, nil, -5, -2, -5,
107
- nil, -18, -21 ]
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
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-07 00:00:00.000000000 Z
11
+ date: 2018-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler