From 40625c16f7573398252ccf040ef49d398d64d5bd Mon Sep 17 00:00:00 2001 From: Alasdair Date: Thu, 13 Aug 2020 11:27:31 +0100 Subject: 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. --- src/initial_check.mli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/initial_check.mli') diff --git a/src/initial_check.mli b/src/initial_check.mli index 59c8f0b6..5a352eee 100644 --- a/src/initial_check.mli +++ b/src/initial_check.mli @@ -103,7 +103,7 @@ val process_ast : ?generate:bool -> Parse_ast.defs -> unit defs val extern_of_string : id -> string -> unit def val val_spec_of_string : id -> string -> unit def val ast_of_def_string : string -> unit defs -val ast_of_def_string_with : (Parse_ast.defs -> Parse_ast.defs) -> string -> unit defs +val ast_of_def_string_with : (Parse_ast.def list -> Parse_ast.def list) -> string -> unit defs val exp_of_string : string -> unit exp val typ_of_string : string -> typ val constraint_of_string : string -> n_constraint -- cgit v1.2.3