summaryrefslogtreecommitdiff
path: root/src/ast_util.mli
diff options
context:
space:
mode:
authorAlasdair2020-08-13 11:27:31 +0100
committerAlasdair2020-08-13 15:47:21 +0100
commit40625c16f7573398252ccf040ef49d398d64d5bd (patch)
tree378aba617a045c866c53d8938ce13f92562e06cf /src/ast_util.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/ast_util.mli')
-rw-r--r--src/ast_util.mli4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ast_util.mli b/src/ast_util.mli
index 1449a390..6ac29123 100644
--- a/src/ast_util.mli
+++ b/src/ast_util.mli
@@ -527,3 +527,7 @@ val quant_item_subst_kid : kid -> kid -> quant_item -> quant_item
val typquant_subst_kid : kid -> kid -> typquant -> typquant
val simple_string_of_loc : Parse_ast.l -> string
+
+(** Attach comments produced by the lexer into their nearest nodes in
+ the abstract syntax tree *)
+val attach_comments : Lexer.comment list -> 'a def list -> 'a def list