aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/cAst.mli
diff options
context:
space:
mode:
authorGravatar Emilio Jesus Gallego Arias <e+git@x80.org>2017-04-08 23:19:35 +0200
committerGravatar Emilio Jesus Gallego Arias <e+git@x80.org>2017-04-25 00:32:37 +0200
commit054d2736c1c1b55cb7708ff0444af521cd0fe2ba (patch)
tree5228705fd054a59afec759eec780d2b4e9b53435 /lib/cAst.mli
parentd062642d6e3671bab8a0e6d70e346325558d2db3 (diff)
[location] [ast] Switch Constrexpr AST to an extensible node type.
Following @gasche idea, and the original intention of #402, we switch the main parsing AST of Coq from `'a Loc.located` to `'a CAst.ast` which is private and record-based. This provides significantly clearer code for the AST, and is robust wrt attributes.
Diffstat (limited to 'lib/cAst.mli')
-rw-r--r--lib/cAst.mli22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/cAst.mli b/lib/cAst.mli
new file mode 100644
index 000000000..291536d12
--- /dev/null
+++ b/lib/cAst.mli
@@ -0,0 +1,22 @@
+(************************************************************************)
+(* v * The Coq Proof Assistant / The Coq Development Team *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
+(* \VV/ **************************************************************)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(************************************************************************)
+
+(** The ast type contains generic metadata for AST nodes *)
+type 'a ast = private {
+ v : 'a;
+ loc : Loc.t option;
+}
+
+val make : ?loc:Loc.t -> 'a -> 'a ast
+
+val map : ('a -> 'b) -> 'a ast -> 'b ast
+val map_with_loc : (?loc:Loc.t -> 'a -> 'b) -> 'a ast -> 'b ast
+val map_from_loc : (?loc:Loc.t -> 'a -> 'b) -> 'a Loc.located -> 'b ast
+
+val with_val : ('a -> 'b) -> 'a ast -> 'b
+val with_loc_val : (?loc:Loc.t -> 'a -> 'b) -> 'a ast -> 'b