Reworked handling of getting bottom node. Now uses an iterator to iterate from bottom to top nodes

This commit is contained in:
2018-11-27 18:38:28 +01:00
parent dd8569ecb0
commit 8ece53db5b
25 changed files with 198 additions and 89 deletions

View File

@@ -0,0 +1,23 @@
using System.Linq;
using Upsilon.Binder;
namespace Upsilon.Utilities
{
public static class SearchHelper
{
public static BoundScope GetScopeAt(this BoundScript script, int characterPosition)
{
var scope = script.Scope;
foreach (var node in script.GetNodeAtPosition(characterPosition))
{
}
return scope;
}
public static BoundNode GetBottomNodeAtPosition(this BoundNode node, int characterPosition)
{
return node.GetNodeAtPosition(characterPosition).First();
}
}
}