Example #1
0
        private LocationInfo GetLoc(FunctionDefinition node)
        {
            var s = node.Header;
            var e = node.GetEnd(_tree);

            return(new LocationInfo(
                       _filename,
                       s.Line, s.Column,
                       e.Line, e.Column
                       ));
        }
Example #2
0
        internal LocationInfo GetLoc(FunctionDefinition node)
        {
            if (node == null || node.StartIndex >= node.EndIndex)
            {
                return(null);
            }

            var start = node.NameExpression?.GetStart(_ast) ?? node.GetStart(_ast);
            var end   = node.GetEnd(_ast);

            return(new LocationInfo(_filePath, start.Line, start.Column, end.Line, end.Column));
        }
Example #3
0
            public override bool Walk(FunctionDefinition node)
            {
                var start = node.GetStart(_root);
                var end   = node.GetEnd(_root);

                if (start.Line <= _line && end.Line >= _line)
                {
                    FunctionName = node.Name;
                }

                return(base.Walk(node));
            }