Skip to content

Commit 26f3af7

Browse files
v3.0.1
1 parent 8206963 commit 26f3af7

5 files changed

Lines changed: 9 additions & 63 deletions

File tree

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
code-ruby (3.0.0)
4+
code-ruby (3.0.1)
55
activesupport
66
base64
77
bigdecimal

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0.0
1+
3.0.1

lib/code/node/square_bracket.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ def evaluate(**args)
2222
def resolve(**args)
2323
left = @left&.resolve(**args) || Object::Nothing.new
2424

25-
list = Object::IdentifierList.new([left])
25+
list =
26+
if left.is_an?(Object::IdentifierList)
27+
Object::IdentifierList.new(left.raw.dup)
28+
else
29+
Object::IdentifierList.new([left])
30+
end
2631

2732
(@statements || []).each do |statement|
2833
list.code_append(statement.evaluate(**args))

spec/code/object/identifier_list_spec.rb

Lines changed: 0 additions & 60 deletions
This file was deleted.

spec/code_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,7 @@ def evaluate_with_output(input)
412412
['"Hello {1}"', '"Hello 1"'],
413413
['user = {} user.name = "Dorian" user.name', ":Dorian"],
414414
['user = {} user[:name] = "Dorian" user[:name]', ":Dorian"],
415+
['value = {} email = "a" calendar_id = "c" value[email] ||= {} value[email][calendar_id] ||= {} value[email][calendar_id]', "{}"],
415416
['{ "first_name": "Dorian" }', '{"first_name" => "Dorian"}'],
416417
['{ "first_name": "Dorian" }.as_json', '{"first_name" => "Dorian"}'],
417418
%w[nothing.to_json :null],

0 commit comments

Comments
 (0)