Explorar el Código

Move hash of labels to global scope

ApisNecros hace 4 meses
padre
commit
f3f2348222
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      yaict.pl

+ 2 - 2
yaict.pl

@@ -8,6 +8,8 @@ my $VERSION = 0.01;
 
 # The array of intcodes making up the program
 my @program;
+# A hash of labels and their corresponding starting line number
+my %labels;
 # Opcodes that may be encounted and their corresponding ints
 my %opcodes = (
     "add"   => "01",
@@ -41,8 +43,6 @@ sub parseAssembly
 {
 
     my @assembly = @_;
-    # A hash of labels and their corresponding starting line number
-    my %labels;
     # The current instruction number
     my $instructionNumber = 0;