private static Position GetStartPosition(string content, int position) { var parser = new MarkupGrammar(); Position startPosition = null; var endPosition = Source(content); ParseResult <Node> currentNode = null; while (endPosition.Offset < position) { startPosition = endPosition; currentNode = parser.AnyNode(startPosition); endPosition = currentNode.Rest; } return(startPosition); }
private static Position GetStartPosition(string content, int position) { var parser = new MarkupGrammar(); Position startPosition = null; var endPosition = Source(content); ParseResult<Node> currentNode = null; while (endPosition.Offset < position) { startPosition = endPosition; currentNode = parser.AnyNode(startPosition); endPosition = currentNode.Rest; } return startPosition; }