Skip to content

Commit fde2591

Browse files
committed
Add interface LabelledStatementInfo
1 parent 742637b commit fde2591

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/compiler/parser.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,14 @@ module ts {
385385
CrossingFunctionBoundary
386386
}
387387

388+
interface LabelledStatementInfo {
389+
addLabel(label: Identifier): void;
390+
pushCurrentLabelSet(isIterationStatement: boolean): void;
391+
pushFunctionBoundary(): void;
392+
pop(): void;
393+
nodeIsNestedInLabel(label: Identifier, requireIterationStatement: boolean, stopAtFunctionBoundary: boolean): ControlBlockContext;
394+
}
395+
388396
export function createSourceFile(filename: string, sourceText: string, languageVersion: ScriptTarget): SourceFile {
389397
var file: SourceFile;
390398
var scanner: Scanner;
@@ -402,8 +410,7 @@ module ts {
402410
var inSwitchStatement = ControlBlockContext.NotNested;
403411
var inIterationStatement = ControlBlockContext.NotNested;
404412

405-
var labelledStatementInfo = (() => {
406-
// TODO(jfreeman): Implement a data structure for tracking labels
413+
var labelledStatementInfo: LabelledStatementInfo = (() => {
407414
var functionBoundarySentinel: StringSet = {};
408415
var currentLabelSet: StringSet;
409416
var labelSetStack: StringSet[];

0 commit comments

Comments
 (0)