Skip to content

Commit 0ffd091

Browse files
committed
Merge branch 'hotfix-0.1.1'
2 parents 3a00d25 + 206c88b commit 0ffd091

5 files changed

Lines changed: 16 additions & 15 deletions

File tree

lib/code_breaker/parsable/data_types.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,11 @@ def parse_int_node(node)
4545
node.children[0].class
4646
end
4747

48-
def parse_hash_node(node)
49-
{ node.type => parse_children(node).inject(:merge).to_h }
50-
end
51-
5248
def parse_pair_node(node)
5349
{ parse(node.children[0]) => parse(node.children[1]) }
5450
end
5551

52+
alias :parse_hash_node :parse_as_hash
5653
alias :parse_array_node :parse_as_hash
5754
end
5855
end

lib/code_breaker/parsable/keywords.rb

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,14 @@ module Keywords
1111
alias :parse_or_node :parse_as_hash
1212
alias :parse_and_node :parse_as_hash
1313
alias :parse_def_node :parse_as_hash
14-
alias :parse_module_node :parse_as_hash
1514
alias :parse_yield_node :parse_as_hash
16-
17-
alias :parse_break_node :parse_as_node_type
18-
alias :parse_next_node :parse_as_node_type
19-
alias :parse_retry_node :parse_as_node_type
20-
alias :parse_self_node :parse_as_node_type
2115
alias :parse_rescue_node :parse_as_hash
22-
alias :parse_resbody_node :parse_as_hash
23-
alias :parse_case_node :parse_as_hash
16+
alias :parse_resbody_node :parse_as_hash
17+
18+
alias :parse_break_node :parse_as_node_type
19+
alias :parse_next_node :parse_as_node_type
20+
alias :parse_retry_node :parse_as_node_type
21+
alias :parse_self_node :parse_as_node_type
2422

2523
def parse_loop_node(node)
2624
condition = node.children[0]

lib/code_breaker/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module CodeBreaker
2-
VERSION = "0.1.0"
2+
VERSION = "0.1.1"
33
end

spec/code_breaker/parser/data_types_spec.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@
3232
context 'for a root node representing a Hash' do
3333
it 'returns a Hash with key :hash and a Hash of key/type pairs' do
3434
input = "{ euro: '€', 'dollar' => 1.1521 }"
35-
output = { hash: { Symbol => String, String => Float } }
35+
output = { hash: [{ Symbol => String }, { String => Float }] }
36+
expect(input).to be_parsed_as output
37+
end
38+
39+
it 'returns a Hash with key :hash and a Hash of key/type pairs' do
40+
input = "{ euro: '€', dollar: 1.1521 }"
41+
output = { hash: [{ Symbol => String }, { Symbol => Float }] }
3642
expect(input).to be_parsed_as output
3743
end
3844
end

spec/code_breaker/parser/language_elements_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
{
8181
args: [
8282
{ arg: :name},
83-
{ optarg: [:options, { hash: { Symbol => Fixnum } }] }
83+
{ optarg: [:options, { hash: [{ Symbol => Fixnum }] }] }
8484
]
8585
},
8686
String

0 commit comments

Comments
 (0)