This instance will be upgraded to Heptapod 0.25.0 (final) on 2021-09-22 at 15:00 UTC+2 (a few minutes of down time)

Commit c33c720b authored by Jesse McGrew's avatar Jesse McGrew
Browse files

Fixed bug where routines created by PROPSPECs broke compilation.

parent 2a75b2c9ccac
......@@ -424,6 +424,17 @@ namespace IntegrationTests
"<=? <GET <GETP ,BAR ,P?FOO> 0> ,W?FOO>");
}
[TestMethod]
public void Routines_Created_By_PROPSPEC_Should_Work_Correctly()
{
AssertGlobals(
"<PUTPROP FOO PROPSPEC FOO-PROP>",
"<DEFINE FOO-PROP (L) <ROUTINE PROP-ROUTINE () 123> (<> PROP-ROUTINE)>",
"<OBJECT BAR (FOO FOO)>")
.Implies(
"<=? <APPLY <GETP ,BAR ,P?FOO>> 123>");
}
#endregion
[TestMethod]
......
......@@ -248,6 +248,16 @@ namespace Zilf.Compiler
}
}
// builders for routines (again, in case any were added during compilation, e.g. by a PROPSPEC)
foreach (ZilRoutine routine in ctx.ZEnvironment.Routines)
{
if (!cc.Routines.ContainsKey(routine.Name))
cc.Routines.Add(routine.Name, gb.DefineRoutine(
routine.Name.ToString(),
routine.Name == ctx.ZEnvironment.EntryRoutineName,
(routine.Flags & RoutineFlags.CleanStack) != 0));
}
// compile routines
IRoutineBuilder mainRoutine = null;
......
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