Reworked handling of getting bottom node. Now uses an iterator to iterate from bottom to top nodes
This commit is contained in:
23
Upsilon/Utilities/SearchHelper.cs
Normal file
23
Upsilon/Utilities/SearchHelper.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user