diff options
| author | filliatr | 1999-12-07 14:56:36 +0000 |
|---|---|---|
| committer | filliatr | 1999-12-07 14:56:36 +0000 |
| commit | f2da732ffd5db2b93a2c8120c668f8b2f6068d3b (patch) | |
| tree | 6cf46158c757cb654c241728eed3ea03bd04d0d0 /parsing/coqast.ml | |
| parent | 59263ca55924e2f43097ae2296f541b153981bf8 (diff) | |
debuggage inductifs (suite) / compilation Dhyp et Auto (mais pas linkes
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@220 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'parsing/coqast.ml')
| -rw-r--r-- | parsing/coqast.ml | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/parsing/coqast.ml b/parsing/coqast.ml index b0a825326c..0f0dcda29c 100644 --- a/parsing/coqast.ml +++ b/parsing/coqast.ml @@ -15,6 +15,22 @@ type t = type the_coq_ast = t +let subst_meta bl ast = + let rec aux = function + | Node (_,"META", [Num(_, n)]) -> List.assoc n bl + | Node(loc, node_name, args) -> + Node(loc, node_name, List.map aux args) + | Slam(loc, var, arg) -> Slam(loc, var, aux arg) + | other -> other + in + aux ast + +let rec collect_metas = function + | Node (_,"META", [Num(_, n)]) -> [n] + | Node(_, _, args) -> List.concat (List.map collect_metas args) + | Slam(loc, var, arg) -> collect_metas arg + | _ -> [] + (* Hash-consing *) module Hloc = Hashcons.Make( struct |
