Skip to content
This repository
Newer
Older
100644 75 lines (59 sloc) 2.256 kb
fccc6851 »
2011-06-21 Initial open-source release
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 Typing Directives (language and compilation).
21 *)
22
23 (**
24 This module can regroup utils working on directives.
25 It is meant to be not far after QmlAst wrt the dependencies between modules.
26 Possibly, the printer of string_of_directives can also be moved in that file.
27 *)
28
29 (**
30 The type of the variant used for directives.
31 Ideally in S4, the same variant groups should be shared between OPA and QML
32 *)
33 type directive = QmlAst.qml_directive
34
35
36 (** {6 Type of Directive} *)
37
38 (**
39 A directive is used for extensible utilisation of the AST.
40 It can have a som expressions in arguments, and some types as well.
41 Currently, it is not possible in the syntax to write types arguments for a directives,
42 but it is a TODO.
43 See some examples :
44 {[
45 \@take_expr_and_ty("titi", "toto" ; float, (int -> int), (int, char -> bool))
46 \@take_just_ty(; char)
47 \@take_just_expr("titi")
48 ]}
49
50 The type of directive is known statically, and defined in this module.
51 The typer, as well as [QmlAstCons.TypedExpr] use this module to type directive.
52 *)
53 val ty : directive -> QmlAst.expr list -> QmlAst.ty list -> QmlAst.ty
54
55 (** {6 Utils} *)
56
57 (**
58 Get the arguments of the directive `create_lazy_record directives.
59 The info is optional, the arguments are on the form :
60 {[
61 | [expr]
62 | [expr ; info]
63 ]}
64 The returned tuple is the expr, and the optional info
65 *)
66 val create_lazy_record_arguments :
67 QmlAst.expr list ->
68 QmlAst.expr * QmlAst.expr option
69
70 val create_lazy_record_exprs :
71 QmlAst.expr -> QmlAst.expr option ->
72 QmlAst.expr list
2536662d »
2011-09-23 [feature] closure serialisation: restrict to new @public_env directive
73
74 val to_string : directive -> string
Something went wrong with that request. Please try again.