Lots of work on type binding

This commit is contained in:
2018-11-11 18:12:42 +01:00
parent 699377cdfc
commit 3561979ded
23 changed files with 530 additions and 142 deletions

View File

@@ -1,4 +1,6 @@
using System.Collections.Generic;
using Upsilon.BaseTypes;
using Upsilon.Parser;
using Upsilon.Text;
namespace Upsilon
@@ -37,6 +39,16 @@ namespace Upsilon
{
LogError($"Null Reference Encountered", span);
}
public void LogUnknownType(TextSpan eSpan)
{
LogError($"Unknown Type found", eSpan);
}
public void LogUnknownOperator(TextSpan eSpan, SyntaxKind text, Type leftType, Type rightType)
{
LogError($"No binary operator {text} found for types '{leftType}' and '{rightType}'", eSpan);
}
}
public class DiagnosticsMessage
@@ -71,7 +83,7 @@ namespace Upsilon
public string AfterError(int i = 5)
{
return Diagnostics.ScriptString.GetSpan(Span.Start + 1, i);
return Diagnostics.ScriptString.GetSpan(Span.Start + Span.Length, i);
}
}