Skip to content

Commit e404a6f

Browse files
author
t-kazu
committed
eslintと優先順位の修正を行いました
1 parent 2967fcd commit e404a6f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/lib/ruby-generator/data.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ export default function (Blockly) {
5454
};
5555

5656
Blockly.Ruby.data_insertatlist = function (block) {
57-
const index = Blockly.Ruby.valueToCode(block, 'INDEX', Blockly.Ruby.ORDER_NONE) - 1 || 0;
57+
const index = Blockly.Ruby.valueToCode(block, 'INDEX', Blockly.Ruby.ORDER_INDEX) - 1 || 0;
5858
const item = Blockly.Ruby.valueToCode(block, 'ITEM', Blockly.Ruby.ORDER_NONE) || '0';
5959
const list = Blockly.Ruby.listName(block.getFieldValue('LIST'));
6060
return `${list}.insert(${index}, ${item})\n`;
6161
};
6262

6363
Blockly.Ruby.data_replaceitemoflist = function (block) {
64-
const index = Blockly.Ruby.valueToCode(block, 'INDEX', Blockly.Ruby.ORDER_INDEX) - 1 || 0;
64+
const index = Blockly.Ruby.valueToCode(block, 'INDEX', Blockly.Ruby.ORDER_NONE) - 1 || 0;
6565
const item = Blockly.Ruby.valueToCode(block, 'ITEM', Blockly.Ruby.ORDER_NONE) || '0';
6666
const list = Blockly.Ruby.listName(block.getFieldValue('LIST'));
6767
return `${list}[${index}] = ${item}\n`;
@@ -70,13 +70,13 @@ export default function (Blockly) {
7070
Blockly.Ruby.data_itemoflist = function (block) {
7171
const index = Blockly.Ruby.valueToCode(block, 'INDEX', Blockly.Ruby.ORDER_INDEX) - 1 || 0;
7272
const list = Blockly.Ruby.listName(block.getFieldValue('LIST'));
73-
return `${list}[${index}]\n`;
73+
return [`${list}[${index}]`, Blockly.Ruby.ORDER_FUNCTION_CAL];
7474
};
7575

7676
Blockly.Ruby.data_itemnumoflist = function (block) {
7777
const item = Blockly.Ruby.valueToCode(block, 'ITEM', Blockly.Ruby.ORDER_NONE) || '0';
7878
const list = Blockly.Ruby.listName(block.getFieldValue('LIST'));
79-
return `${list}.index(${item})`;
79+
return [`${list}.index(${item})`, Blockly.Ruby.ORDER_FUNCTION_CAL];
8080
};
8181

8282
Blockly.Ruby.data_lengthoflist = function (block) {

src/lib/ruby-generator/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,15 +346,15 @@ export default function (Blockly) {
346346
};
347347

348348
Blockly.Ruby.variableName = function (name) {
349-
let variable = this.editingTarget.lookupOrCreateVariable(name);
349+
const variable = this.editingTarget.lookupOrCreateVariable(name);
350350
if (variable) {
351351
return variable.name;
352352
}
353353
return null;
354354
};
355355

356356
Blockly.Ruby.listName = function (name) {
357-
let list = this.editingTarget.lookupOrCreateList(name);
357+
const list = this.editingTarget.lookupOrCreateList(name);
358358
if (list) {
359359
return list.name;
360360
}

0 commit comments

Comments
 (0)