diff --git a/crates/oxide_compiler/src/compiler.rs b/crates/oxide_compiler/src/compiler.rs index ba246941..936e2e17 100644 --- a/crates/oxide_compiler/src/compiler.rs +++ b/crates/oxide_compiler/src/compiler.rs @@ -125,6 +125,17 @@ pub(crate) enum Label { CatchBody(u32), FinallyBody(u32), TryEnd(u32), + LabeledEnd(u32), +} + +/// A labeled-statement scope active during emission. `break label` targets +/// `break_label`; `continue label` targets `continue_label` (only set when the +/// labeled statement directly wraps an iteration statement). +#[derive(Debug, Clone)] +pub(crate) struct LabelScope { + pub(crate) name: String, + pub(crate) break_label: Label, + pub(crate) continue_label: Option