Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 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;
 }