From 054d2736c1c1b55cb7708ff0444af521cd0fe2ba Mon Sep 17 00:00:00 2001 From: Emilio Jesus Gallego Arias Date: Sat, 8 Apr 2017 23:19:35 +0200 Subject: [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. --- lib/cAst.ml | 24 ++++++++++++++++++++++++ lib/cAst.mli | 22 ++++++++++++++++++++++ lib/clib.mllib | 1 + 3 files changed, 47 insertions(+) create mode 100644 lib/cAst.ml create mode 100644 lib/cAst.mli (limited to 'lib') diff --git a/lib/cAst.ml b/lib/cAst.ml new file mode 100644 index 0000000000..5916c9ec12 --- /dev/null +++ b/lib/cAst.ml @@ -0,0 +1,24 @@ +(************************************************************************) +(* v * The Coq Proof Assistant / The Coq Development Team *) +(* '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 diff --git a/lib/clib.mllib b/lib/clib.mllib index c73ae9b904..9eb479fcc9 100644 --- a/lib/clib.mllib +++ b/lib/clib.mllib @@ -18,6 +18,7 @@ IStream Flags Control Loc +CAst CList CString Deque -- cgit v1.2.3