/// Apply the label at the current instruction offset.
Apply the label at the current instruction offset.
Apply the label at the current instruction offset .
pub(crate) fn label(&mut self, label: Label) -> Result<Label, CompileError> {
        let offset = self.instructions.len();
        if self.labels.insert(label, offset).is_some() {
            return Err(CompileError::new(
                self.location.span,
                CompileErrorKind::DuplicateLabel { label },
            ));
        }
        self.labels_rev.insert(offset, label);
        Ok(label)
    }
pub ( crate ) fn label ( & mut self , label : Label ) -> Result < Label , CompileError > { let offset = self . instructions . len ( ) ; if self . labels . insert ( label , offset ) . is_some ( ) { return Err ( CompileError :: new ( self . location . span , CompileErrorKind :: DuplicateLabel { label } , ) ) ; } self . labels_rev . insert ( offset , label ) ; Ok ( label ) }
Apply the label at the current instruction offset.
Apply the label at the current instruction offset .
&mut self
label
Label