This instance will be upgraded to Heptapod 0.17.0 on 2020-11-26 at 14:00 UTC+1 (a few minutes of down time)

Commit 7c9a78b1 authored by Jesse McGrew's avatar Jesse McGrew

Use TranslateString instead of ToStringContext for the DESC pseudo-property.

[ZILF-222]
parent c39a855c5417
......@@ -574,7 +574,7 @@ namespace Zilf.Compiler
Context.HandleError(new CompilerError(model, CompilerMessages.Values_For_0_Property_Must_Be_1, propName, "strings"));
continue;
}
ob.DescriptiveName = value.ToStringContext(Context, true);
ob.DescriptiveName = TranslateString((ZilString)value, Context);
// skip the length validation
continue;
......
......@@ -564,5 +564,14 @@ namespace Zilf.Tests.Integration
.WithoutWarnings()
.DoesNotCompile();
}
[TestMethod]
public void DESC_Pseudo_Property_Should_Be_Stripped_Of_Newlines()
{
AssertRoutine("",
"<PRINTD ,FOO>")
.WithGlobal("<OBJECT FOO (DESC \"first\nsecond\r\nthird\")>")
.Outputs("first second third");
}
}
}
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