예제 #1
0
        public static CodeRange LocateWithHiddens(CstNode node)
        {
            var tuple = node.AllTokensWithHiddens().FirstAndLastOrNull();

            if (tuple != null)
            {
                var firstToken = tuple.Item1;
                var lastToken  = tuple.Item2;
                return(new CodeRange(
                           new CodeLocation(firstToken.StartLine, firstToken.StartPosition),
                           new CodeLocation(lastToken.EndLine, lastToken.EndPosition)));
            }
            return(Nil);
        }