Commit 61c6f456 authored by Jesse McGrew's avatar Jesse McGrew
Browse files

Fixed debug line info being missing from local variable initializers. [ZILF-4]

parent 881830cb2885
......@@ -203,6 +203,8 @@ namespace Zilf.Compiler
if (lb.DefaultValue != null)
MarkSequencePoint(rb, arg.DefaultValue);
ILabel? nextLabel = null;
// ReSharper disable once SwitchStatementMissingSomeCases
......@@ -674,5 +674,19 @@ namespace Zilf.Tests.Integration
.AndNotMatching(@"(\.DEBUG-LINE ([^\r\n]*)\r?\n).*\1");
public async Task Local_Variable_Initializers_Should_Have_Debug_Line_Info()
const string ArgSpec = @"""OPT"" (A <FOO>) ""AUX"" (B <FOO>)";
const string Body = @"<>";
await AssertRoutine(ArgSpec, Body)
.WithGlobal("<ROUTINE FOO () <>>")
.GeneratesCodeMatchingAsync(@"\.DEBUG-LINE ([^\r\n]*)\r?\n\s*ASSIGNED\? 'A")
.AndMatching(@"\.DEBUG-LINE ([^\r\n]*)\r?\n\s*(\S+:\s*)?CALL1 FOO >B");
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment