diff options
| author | herbelin | 2003-04-17 15:01:24 +0000 |
|---|---|---|
| committer | herbelin | 2003-04-17 15:01:24 +0000 |
| commit | 5b318ca418ef27d1bf2b155bebbf2425f65b4f1f (patch) | |
| tree | b04fb45d1fd3e8fb6b4253a2acbd595754ec7dc6 /interp | |
| parent | 95f8a0ac38cbd792a0b5d8006aac1ef1a9f70da8 (diff) | |
Ajout "at next level" dans Notation
Mise en place structure pour définir un objet en même temps que sa notation
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@3939 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'interp')
| -rw-r--r-- | interp/symbols.ml | 11 | ||||
| -rw-r--r-- | interp/symbols.mli | 3 |
2 files changed, 14 insertions, 0 deletions
diff --git a/interp/symbols.ml b/interp/symbols.ml index 0c988f315c..ef2cf6b0b8 100644 --- a/interp/symbols.ml +++ b/interp/symbols.ml @@ -396,6 +396,17 @@ let locate_notation prraw ntn = fnl ())) l +let find_notation_level ntn = + let l = + Stringmap.fold + (fun _ sc l -> + try fst (snd (Stringmap.find ntn sc.notations)) :: l + with Not_found -> l) !scope_map [] in + match l with + | [] -> raise Not_found + | [prec] -> prec + | prec::_ -> warning ("Several parsing rules for notation \""^ntn^"\""); prec + (**********************************************************************) (* Mapping notations to concrete syntax *) diff --git a/interp/symbols.mli b/interp/symbols.mli index 42eedaf81c..fa3d778f1b 100644 --- a/interp/symbols.mli +++ b/interp/symbols.mli @@ -117,6 +117,9 @@ val pr_scope : (rawconstr -> std_ppcmds) -> scope_name -> std_ppcmds val pr_scopes : (rawconstr -> std_ppcmds) -> std_ppcmds val locate_notation : (rawconstr -> std_ppcmds) -> notation -> std_ppcmds +(* [raise Not_found] if non existing notation *) +val find_notation_level : notation -> level + (**********************************************************************) (*s Printing rules for notations *) |
