File: locate-doc.m2

package info (click to toggle)
macaulay2 1.21%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 133,096 kB
  • sloc: cpp: 110,377; ansic: 16,306; javascript: 4,193; makefile: 3,821; sh: 3,580; lisp: 764; yacc: 590; xml: 177; python: 140; perl: 114; lex: 65; awk: 3
file content (54 lines) | stat: -rw-r--r-- 1,481 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
--- status: moved February 2021
--- author(s):
--- notes:

doc ///
Node
  Key
    locate
   (locate, Symbol)
   (locate, Sequence)
   (locate, Pseudocode)
   (locate, Function)
   (locate, Nothing)
   (locate, List)
   (locate, ZZ)
  Headline
    locate source code
  Usage
    locate f
  Inputs
    x:{Function,Sequence,Symbol,List,ZZ}
  Outputs
    :{Sequence,List,Nothing}
      {\tt (filename, start,startcol, stop,stopcol, pos,poscol)}, respectively
  Description
    Text
      For a symbol interpreted function {\tt f}, returns a sequence {\tt (n,i,c,j,d,k,e)}
      describing the location of the definition in the source code:
    Tree
      :The name of the source file is {\tt n};
      :the code occupies line {\tt i} column {\tt c} through line {\tt j} column {\tt d};
      :the central point of interest located at line {\tt k} column {\tt e}.
    Example
      locate needs
      code needs
    Text
      If {\tt f} is a sequence, then @TO "lookup"@ is applied first,
      and the location of the resulting function is provided.
    Example
      locate(resolution, Module)
    Text
      In particular, the output of @TO "methods"@ can be used as an input to @TT "locate"@.
    Example
      locate methods resolution
      methods doc
      locate 0
    Text
      If the function {\tt f} is compiled, or if {\tt f} is @TO "null"@,
      then a location is not available and @TO "null"@ is returned.
  SeeAlso
    code
    methods
    (locate, DocumentTag)
///