summaryrefslogtreecommitdiff
path: root/src/process_file.mli
diff options
context:
space:
mode:
authorAlasdair2020-08-13 11:27:31 +0100
committerAlasdair2020-08-13 15:47:21 +0100
commit40625c16f7573398252ccf040ef49d398d64d5bd (patch)
tree378aba617a045c866c53d8938ce13f92562e06cf /src/process_file.mli
parent2736af39811331502c7f5bc7e2bd8f590f1f9b2a (diff)
Preserve file structure through initial check
Insert $file_start and $file_end pragmas in the AST, as well as $include_start and $include_end pragmas so we can reconstruct the original file structure later if needed, provided nothing like topological sorting has been done. Have the Lexer produce a list of comments whenever it parses a file, which can the be attached to the nearest nodes in the abstract syntax tree.
Diffstat (limited to 'src/process_file.mli')
-rw-r--r--src/process_file.mli4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/process_file.mli b/src/process_file.mli
index c9eb5e9e..3b23b1bd 100644
--- a/src/process_file.mli
+++ b/src/process_file.mli
@@ -50,13 +50,13 @@
(** Parse a file. The optional loc argument is the location of the
$include directive that is importing the file, if applicable. *)
-val parse_file : ?loc:Parse_ast.l -> string -> Parse_ast.defs
+val parse_file : ?loc:Parse_ast.l -> string -> Lexer.comment list * Parse_ast.def list
val clear_symbols : unit -> unit
val have_symbol : string -> bool
val add_symbol : string -> unit
-val preprocess_ast : (Arg.key * Arg.spec * Arg.doc) list -> Parse_ast.defs -> Parse_ast.defs
+val preprocess : (Arg.key * Arg.spec * Arg.doc) list -> Parse_ast.def list -> Parse_ast.def list
val check_ast : Type_check.Env.t -> unit Ast.defs -> Type_check.tannot Ast.defs * Type_check.Env.t
val rewrite_ast_initial : Type_check.Env.t -> Type_check.tannot Ast.defs -> Type_check.tannot Ast.defs * Type_check.Env.t
val rewrite_ast_target : string -> Type_check.Env.t -> Type_check.tannot Ast.defs -> Type_check.tannot Ast.defs * Type_check.Env.t