Skip to content

Commit

Permalink
chore: Add docstring.
Browse files Browse the repository at this point in the history
  • Loading branch information
gonfunko committed Nov 21, 2024
1 parent 33ccbdc commit 9606cef
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions core/block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,38 +23,38 @@ import * as common from './common.js';
import {Connection} from './connection.js';
import {ConnectionType} from './connection_type.js';
import * as constants from './constants.js';
import {DuplicateIconType} from './icons/exceptions.js';
import type {Abstract} from './events/events_abstract.js';
import type {BlockChange} from './events/events_block_change.js';
import type {BlockMove} from './events/events_block_move.js';
import * as deprecation from './utils/deprecation.js';
import * as eventUtils from './events/utils.js';
import * as Extensions from './extensions.js';
import type {Field} from './field.js';
import * as fieldRegistry from './field_registry.js';
import {Input} from './inputs/input.js';
import {DuplicateIconType} from './icons/exceptions.js';
import {IconType} from './icons/icon_types.js';
import type {MutatorIcon} from './icons/mutator_icon.js';
import {Align} from './inputs/align.js';
import {DummyInput} from './inputs/dummy_input.js';
import {EndRowInput} from './inputs/end_row_input.js';
import {Input} from './inputs/input.js';
import {StatementInput} from './inputs/statement_input.js';
import {ValueInput} from './inputs/value_input.js';
import type {IASTNodeLocation} from './interfaces/i_ast_node_location.js';
import {type IIcon} from './interfaces/i_icon.js';
import {isCommentIcon} from './interfaces/i_comment_icon.js';
import type {MutatorIcon} from './icons/mutator_icon.js';
import {type IIcon} from './interfaces/i_icon.js';
import type {
IVariableModel,
IVariableState,
} from './interfaces/i_variable_model.js';
import * as registry from './registry.js';
import * as Tooltip from './tooltip.js';
import * as arrayUtils from './utils/array.js';
import {Coordinate} from './utils/coordinate.js';
import * as deprecation from './utils/deprecation.js';
import * as idGenerator from './utils/idgenerator.js';
import * as parsing from './utils/parsing.js';
import * as registry from './registry.js';
import {Size} from './utils/size.js';
import type {
IVariableModel,
IVariableState,
} from './interfaces/i_variable_model.js';
import type {Workspace} from './workspace.js';
import {DummyInput} from './inputs/dummy_input.js';
import {EndRowInput} from './inputs/end_row_input.js';
import {ValueInput} from './inputs/value_input.js';
import {StatementInput} from './inputs/statement_input.js';
import {IconType} from './icons/icon_types.js';

/**
* Class for one block.
Expand Down Expand Up @@ -1108,6 +1108,11 @@ export class Block implements IASTNodeLocation {
return null;
}

/**
* Returns a generator that provides every field on the block.
*
* @yields A generator that can be used to iterate the fields on the block.
*/
*getFields(): Generator<Field> {
for (const input of this.inputList) {
for (const field of input.fieldRow) {
Expand Down

0 comments on commit 9606cef

Please sign in to comment.