Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 52 lines (40 sloc) 1.691 kb
fccc685 Initial open-source release
MLstate authored
1 (*
2 Copyright © 2011 MLstate
3
4 This file is part of OPA.
5
6 OPA is free software: you can redistribute it and/or modify it under the
7 terms of the GNU Affero General Public License, version 3, as published by
8 the Free Software Foundation.
9
10 OPA is distributed in the hope that it will be useful, but WITHOUT ANY
11 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
13 more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with OPA. If not, see <http://www.gnu.org/licenses/>.
17 *)
18
19 (**
20 Deprecated module for localisation in the source code.
21 @deprecated Positions management have been unified in [FilePos]
22 *)
23
24 (**
25 The type of informations shared between all nodes of all ASTs.
26
27 TODO: there is here an indirection in the record,
28 QmlAst and OpaAst disagree about how to represent position,
29 and annotation index in the AST.
30 Some benches done by Valentin have shown that inderection for
31 positions and annotation index in the AST have a terrible impact
32 on performance.
33
34 TODO: In QmlAst, maybe flatten the positions and notes in each
35 constructor, like in OpaAst.
36 *)
37 type annot = {
38 pos : FilePos.pos ; (**The position in the code corresponding to this AST*)
39 notes: int ; (**A unique identifier, which may be used to uniquely identifier an AST node. *)
40 }
41
42 (** get the pos field of an annot *)
43 val pos : annot -> FilePos.pos
44
45 (**
46 A convenience structure to uniformly label the nodes of an AST
47 with [annot] data.
48
49 Convenient maybe, but inneficient. (cf TODO)
50 *)
51 type 'a label = 'a * annot
Something went wrong with that request. Please try again.