Skip to content
This repository
Newer
Older
100644 68 lines (53 sloc) 2.631 kb
fccc6851 » MLstate
2011-06-21 Initial open-source release
1 (*
2 Copyright © 2011 MLstate
3
5bb0f1a4 » Aqua-Ye
2012-07-09 [cleanup] compiler: typo on Opa
4 This file is part of Opa.
fccc6851 » MLstate
2011-06-21 Initial open-source release
5
5bb0f1a4 » Aqua-Ye
2012-07-09 [cleanup] compiler: typo on Opa
6 Opa is free software: you can redistribute it and/or modify it under the
fccc6851 » MLstate
2011-06-21 Initial open-source release
7 terms of the GNU Affero General Public License, version 3, as published by
8 the Free Software Foundation.
9
5bb0f1a4 » Aqua-Ye
2012-07-09 [cleanup] compiler: typo on Opa
10 Opa is distributed in the hope that it will be useful, but WITHOUT ANY
fccc6851 » MLstate
2011-06-21 Initial open-source release
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
5bb0f1a4 » Aqua-Ye
2012-07-09 [cleanup] compiler: typo on Opa
16 along with Opa. If not, see <http://www.gnu.org/licenses/>.
fccc6851 » MLstate
2011-06-21 Initial open-source release
17 *)
18 (**
19 This module gathers the passes that statically include some content
20 in the source code
21 *)
22
23
24 val warning_set: WarningClass.Set.t
25
26 (**
27 This pass replaces \@static_binary_content and \@static_source_content with
28 the actual content of the file (in release mode, or with some code to load
29 the file at run time otherwise)
30
31 Assumptions: the files exist on the disk maybe?
32
33 Directives removed : [\[ `static_binary_content | `static_source_content \]]
34
35 Directives added : [\[\]]
36
37 The type doesn't reflect that the directives have disappeared,
38 see the comments at pass_collect_annotations for why it is so
39 *)
40 val pass_static_inclusions :
41 options:OpaEnv.opa_options ->
42 (Ident.t,
43 [< SurfaceAst.all_directives > `coerce `static_content `static_resource] as 'a) SurfaceAst.code ->
44 (Ident.t, 'a) SurfaceAst.code
45
46 (**
47 This pass replaces \@static_include_directory with the construction of a
48 stringmap containing a binding between filename and a tuple of the mimetype
49 and the content of the file.
50 Mimetype and content are resolved on separates passes, on this one, only
51 directives are inserted.
52 By default, only \@static_source_content is used.
53
54 Directives removed : [\[ `static_file_mimetype \]]
55
56 Directives added : [\[ `static_source_content \]]
57 *)
58 val pass_static_inclusion_directory :
59 options:OpaEnv.opa_options ->
60 (Ident.t,
61 [< SurfaceAst.all_directives > `coerce `static_content `static_resource `static_content_directory `static_resource_directory ] as 'a) SurfaceAst.code ->
62 (Ident.t, 'a) SurfaceAst.code
63
64 (* returns a map from files that will be included statically to their date of last modification, or None if the file couldn't be read *)
65 val pass_analyse_static_include_deps :
66 options:OpaEnv.opa_options ->
67 ('ident, [< SurfaceAst.all_directives > `static_content `static_resource `static_content_directory `static_resource_directory ] as 'a) SurfaceAst.code ->
68 float option StringMap.t
Something went wrong with that request. Please try again.