aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2003-09-30 15:12:43 +0000
committerGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2003-09-30 15:12:43 +0000
commitb483429713477413e7432856e862aa69ca644724 (patch)
tree663516d2f9f7e17a6db67e66077d906eec7b9762
parent95b36050b2f2456cbfb8bbe259413711336bac9d (diff)
Les notations hors scope s'empilent maintenant comme des scopes ne
contenant qu'une notation. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@4503 85f007b7-540e-0410-9357-904b9bb8a0f7
-rw-r--r--parsing/esyntax.ml5
-rw-r--r--parsing/extend.ml3
-rw-r--r--parsing/extend.mli3
3 files changed, 8 insertions, 3 deletions
diff --git a/parsing/esyntax.ml b/parsing/esyntax.ml
index 2c0541f4c..08b9f8ab8 100644
--- a/parsing/esyntax.ml
+++ b/parsing/esyntax.ml
@@ -169,12 +169,14 @@ let token_printer stdpr = function
| (Id _ | Num _ | Str _ | Path _ as ast) -> print_ast ast
| a -> stdpr a
+(* Unused ??
(* A primitive printer to do "print as" (to specify a length for a string) *)
let print_as_printer = function
| Node (_, "AS", [Num(_,n); Str(_,s)]) -> Some (stras (n,s))
| ast -> None
let _ = declare_primitive_printer "print_as" default_scope print_as_printer
+*)
(* Handle infix symbols *)
@@ -240,7 +242,8 @@ let call_primitive_parser rec_pr otherwise inherited scopes (se,env) =
| None -> otherwise ()
| Some (scopt,key) ->
print_delimiters inherited se
- (print_syntax_entry rec_pr (option_cons scopt scopes) env
+ (print_syntax_entry rec_pr
+ (option_fold_right Symbols.push_scope scopt scopes) env
{se with syn_hunks = [sub]}) key)
| _ ->
pr_parenthesis inherited se (print_syntax_entry rec_pr scopes env se)
diff --git a/parsing/extend.ml b/parsing/extend.ml
index 6a557f368..1a9bdec91 100644
--- a/parsing/extend.ml
+++ b/parsing/extend.ml
@@ -91,6 +91,7 @@ type syntax_modifier =
| SetAssoc of Gramext.g_assoc
| SetEntryType of string * simple_constr_production_entry
| SetOnlyParsing
+ | SetFormat of string
type nonterm =
| NtShort of string
@@ -289,7 +290,7 @@ type 'pat unparsing_hunk =
| UNP_TBRK of int * int
| UNP_TAB
| UNP_FNL
- | UNP_SYMBOLIC of string * string * 'pat unparsing_hunk
+ | UNP_SYMBOLIC of string option * string * 'pat unparsing_hunk
let rec subst_hunk subst_pat subst hunk = match hunk with
| PH (pat,so,pr) ->
diff --git a/parsing/extend.mli b/parsing/extend.mli
index ef685ffb1..d15376430 100644
--- a/parsing/extend.mli
+++ b/parsing/extend.mli
@@ -79,6 +79,7 @@ type syntax_modifier =
| SetAssoc of Gramext.g_assoc
| SetEntryType of string * simple_constr_production_entry
| SetOnlyParsing
+ | SetFormat of string
type nonterm =
| NtShort of string
@@ -108,7 +109,7 @@ type 'pat unparsing_hunk =
| UNP_TBRK of int * int
| UNP_TAB
| UNP_FNL
- | UNP_SYMBOLIC of string * string * 'pat unparsing_hunk
+ | UNP_SYMBOLIC of string option * string * 'pat unparsing_hunk
(*val subst_unparsing_hunk :
Names.substitution -> (Names.substitution -> 'pat -> 'pat) ->