Reworked diagnostics, saves line positions in memory, instead of calculating later.

This commit is contained in:
2019-01-16 23:57:42 +01:00
parent b5bfb7997b
commit 1d6b5673d6
55 changed files with 322 additions and 351 deletions

View File

@@ -51,11 +51,9 @@ namespace Upsilon.BaseTypes.UserData
}
else
{
var (i, pos) = diagnostics.ScriptString.GetLinePosition(span.Start);
var line = diagnostics.ScriptString.GetLine(i);
throw new ScriptRuntimeException(
$"Tried indexing a CSharp list with a value that's not an integer. Value: {scriptIndex.ToCSharpObject()}",
i, pos, line);
span, diagnostics.ScriptString.GetSpan(span));
}
index--;