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

@@ -107,11 +107,9 @@ namespace Upsilon.BaseTypes.ScriptFunction
// if we haven't found a method, we throw an exception
if (method == null)
{
var (i, pos) = diagnostics.ScriptString.GetLinePosition(span.Start);
var line = diagnostics.ScriptString.GetLine(i);
throw new ScriptRuntimeException(
$"Can't find method {_method.Name} with parameter types {string.Join(", ", convertedTypes.Select(x => x.Name))} on type {_object.GetType().Name}",
i, pos, line);
span, diagnostics.ScriptString.GetSpan(span));
}
// get the method parameters
var parameters = method.GetParameters();