Fix finding bottom node when two nodes are on the same line not working
This commit is contained in:
parent
c1fd6081fd
commit
64aedceb85
|
@ -15,5 +15,11 @@ namespace Upsilon.Binder.VariableSymbols
|
|||
|
||||
public abstract (bool IsValid, string Error, BoundExpression WrongParameter) ValidateParameters(
|
||||
ImmutableArray<BoundExpression> callingParameters);
|
||||
|
||||
public override Type Type
|
||||
{
|
||||
get => Type.Function;
|
||||
set{}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using Upsilon.BaseTypes;
|
||||
using Upsilon.BaseTypes.ScriptFunction;
|
||||
using Upsilon.BaseTypes.UserData;
|
||||
|
||||
|
|
|
@ -176,9 +176,6 @@ namespace Upsilon.StandardLibraries
|
|||
return Type.Boolean;
|
||||
if (typeof(ScriptTable).IsAssignableFrom(type))
|
||||
return Type.Table;
|
||||
if (type == typeof(ScriptType))
|
||||
// allows every type
|
||||
return (Type) 255;
|
||||
|
||||
|
||||
if (type == typeof(IIterable))
|
||||
|
@ -186,6 +183,11 @@ namespace Upsilon.StandardLibraries
|
|||
|
||||
if (typeof(IEnumerable).IsAssignableFrom(type))
|
||||
return Type.Table | Type.UserData;
|
||||
|
||||
if (type == typeof(ScriptType))
|
||||
// allows every type
|
||||
return (Type) 255;
|
||||
|
||||
return Type.UserData;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,6 +27,12 @@ namespace Upsilon.Text
|
|||
|
||||
public bool Contains(int linePosition, int characterPosition)
|
||||
{
|
||||
if (StartLine == EndLine && linePosition == StartLine)
|
||||
{
|
||||
if (characterPosition >= StartPosition && characterPosition <= EndPosition)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
if (StartLine == linePosition && StartPosition <= characterPosition) return true;
|
||||
if (StartLine < linePosition && EndLine > linePosition) return true;
|
||||
if (EndLine == linePosition && EndPosition >= characterPosition) return true;
|
||||
|
|
Loading…
Reference in New Issue