diff options
author | Hugo Herbelin <Hugo.Herbelin@inria.fr> | 2016-10-03 22:12:56 +0200 |
---|---|---|
committer | Hugo Herbelin <Hugo.Herbelin@inria.fr> | 2016-10-03 22:13:55 +0200 |
commit | 14f8db195021e709734ed89d9cb513d1c0db6a93 (patch) | |
tree | 6ec88d1caaeab4ea5453b63234e466a475b67b88 /toplevel | |
parent | 89ec88f1e750cfb786de1929ef44fac70c9a29ab (diff) |
Fixing #4970 (confusion between special "{" and non special "{{" in notations).
Diffstat (limited to 'toplevel')
-rw-r--r-- | toplevel/metasyntax.ml | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/toplevel/metasyntax.ml b/toplevel/metasyntax.ml index 92208e304..4f41043e8 100644 --- a/toplevel/metasyntax.ml +++ b/toplevel/metasyntax.ml @@ -1203,7 +1203,10 @@ let contract_notation ntn = let rec aux ntn i = if i <= String.length ntn - 5 then let ntn' = - if String.is_sub "{ _ }" ntn i then + if String.is_sub "{ _ }" ntn i && + (i = 0 || ntn.[i-1] = ' ') && + (i = String.length ntn - 5 || ntn.[i+5] = ' ') + then String.sub ntn 0 i ^ "_" ^ String.sub ntn (i+5) (String.length ntn -i-5) else ntn in |