25 lines
559 B
C#
25 lines
559 B
C#
namespace Slang;
|
|
|
|
using StationeersIC10Editor;
|
|
|
|
public class SlangFormatter : ICodeFormatter
|
|
{
|
|
public static readonly uint ColorInstruction = ColorFromHTML("#ffff00");
|
|
public static readonly uint ColorString = ColorFromHTML("#ce9178");
|
|
|
|
public override Line ParseLine(string line)
|
|
{
|
|
return Marshal.TokenizeLine(line);
|
|
}
|
|
|
|
public override string Compile()
|
|
{
|
|
if (Marshal.CompileFromString(this.Lines.RawText, out string compiled))
|
|
{
|
|
return compiled;
|
|
}
|
|
|
|
return string.Empty;
|
|
}
|
|
}
|