package nxm.sys.intr;

import nxm.sys.lib.Intrinsic;

/**
  Declare label for target of GOTO etc.

  @author Jeff Schoen

*/
public class Label extends Intrinsic {

  /** default constructor */
  public Label () {}

  public int process() {
    if (M.macro!=null && M.macro.isTxt()) {
      String label = MA.getU(1);
      if (M.macro.level>0 && label.startsWith("END")) {
        M.macro.nextIndex = M.macro.returns[M.macro.level];
        M.results = M.macro.results[M.macro.level];
        M.macro.level--;
      }
    }
    return (FINISH);
  }

}
