removed labelAssigned field. It is not needed. It turns out I had a problem in Record...
authorMichael Welch <michaelgwelch@gmail.com>
Thu, 28 Dec 2006 23:02:23 +0000 (23:02 +0000)
committerMichael Welch <michaelgwelch@gmail.com>
Thu, 28 Dec 2006 23:02:23 +0000 (23:02 +0000)
mbasic/SyntaxTree/Statement.cs

index c580426..74e7e0b 100644 (file)
@@ -30,7 +30,6 @@ namespace mbasic.SyntaxTree
     abstract class Statement : Node
     {
         Label lineLabel;        // A .NET label used to mark this location.
-        bool lineLabelAssigned = false;
 
         protected Statement(LineId line) : base(line)
         {
@@ -40,7 +39,6 @@ namespace mbasic.SyntaxTree
         {
             if (labels.ContainsKey(line.Label) || line.Label == String.Empty) return;
             this.lineLabel = gen.DefineLabel();
-            this.lineLabelAssigned = true;
 
             labels.Add(line.Label, lineLabel);
         }
@@ -57,8 +55,7 @@ namespace mbasic.SyntaxTree
 
         public void MarkLabel(ILGenerator gen)
         {
-            if (lineLabelAssigned)
-                gen.MarkLabel(lineLabel);
+            gen.MarkLabel(lineLabel);
         }
 
         public abstract void Emit(ILGenerator gen, bool labelSetAlready);