Rename enumerateInstructions to enumerateAllInstructions

This commit is contained in:
Florian Rival
2020-04-05 12:02:45 +02:00
parent ed58ebd3be
commit 4c57fbc01f
4 changed files with 11 additions and 11 deletions

View File

@@ -5,7 +5,7 @@ import {
createTree,
type InstructionOrExpressionTreeNode,
} from '../../../InstructionOrExpression/CreateTree';
import { enumerateInstructions } from '../../../InstructionOrExpression/EnumerateInstructions';
import { enumerateAllInstructions } from '../../../InstructionOrExpression/EnumerateInstructions';
import {
type EnumeratedInstructionOrExpressionMetadata,
filterEnumeratedInstructionOrExpressionMetadataByScope,
@@ -28,7 +28,7 @@ const style = {
export default class InstructionSelector extends Component<Props, {||}> {
instructionsInfo: Array<EnumeratedInstructionOrExpressionMetadata> = filterEnumeratedInstructionOrExpressionMetadataByScope(
enumerateInstructions(this.props.isCondition),
enumerateAllInstructions(this.props.isCondition),
this.props.scope
);
instructionsInfoTree: InstructionOrExpressionTreeNode = createTree(

View File

@@ -2,7 +2,7 @@
import * as React from 'react';
import {
enumerateObjectAndBehaviorsInstructions,
enumerateInstructions,
enumerateAllInstructions,
getObjectParameterIndex,
} from '../../InstructionOrExpression/EnumerateInstructions';
import {
@@ -126,7 +126,7 @@ export const useNewInstructionEditor = ({
if (!isNewInstruction) {
// Check if the instruction is an object/behavior instruction. If yes
// select the object, which is the first parameter of the instruction.
const allInstructions = enumerateInstructions(isCondition);
const allInstructions = enumerateAllInstructions(isCondition);
const instructionType: string = instruction.getType();
const enumeratedInstructionMetadata = findInstruction(
allInstructions,

View File

@@ -176,7 +176,7 @@ const enumerateExtensionInstructions = (
/**
* List all the instructions available.
*/
export const enumerateInstructions = (
export const enumerateAllInstructions = (
isCondition: boolean
): Array<EnumeratedInstructionOrExpressionMetadata> => {
let allInstructions = [];

View File

@@ -1,13 +1,13 @@
// @flow
import { createTree } from './CreateTree';
import {
enumerateInstructions,
enumerateAllInstructions,
getObjectParameterIndex,
} from './EnumerateInstructions';
describe('EnumerateInstructions', () => {
it('can enumerate instructions being conditions', () => {
const instructions = enumerateInstructions(true);
const instructions = enumerateAllInstructions(true);
// Test for the proper presence of a few conditions
expect(instructions).toEqual(
@@ -32,7 +32,7 @@ describe('EnumerateInstructions', () => {
});
it('can enumerate instructions being actions', () => {
const instructions = enumerateInstructions(false);
const instructions = enumerateAllInstructions(false);
// Test for the proper presence of a few actions
expect(instructions).toEqual(
@@ -52,7 +52,7 @@ describe('EnumerateInstructions', () => {
});
it('can create the tree of instructions', () => {
const instructions = enumerateInstructions(true);
const instructions = enumerateAllInstructions(true);
expect(createTree(instructions)).toMatchObject({
Advanced: {
'Trigger once while true': {
@@ -72,8 +72,8 @@ describe('EnumerateInstructions', () => {
});
it('can find the object parameter, if any', () => {
const actions = enumerateInstructions(false);
const conditions = enumerateInstructions(true);
const actions = enumerateAllInstructions(false);
const conditions = enumerateAllInstructions(true);
const createInstruction = actions.filter(
({ type }) => type === 'Create'