diff options
author | Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr> | 2016-10-05 17:56:59 +0200 |
---|---|---|
committer | Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr> | 2016-10-05 17:56:59 +0200 |
commit | 8114da3ba8a9b31ffe194e7f7f0239ecc2219b9c (patch) | |
tree | d8924a831c286430001bbf22c68a54eeb3a84233 /toplevel | |
parent | 6cfdf1ca60535f6e9ee6c5e0d5c546d34e803c61 (diff) | |
parent | 14f8db195021e709734ed89d9cb513d1c0db6a93 (diff) |
Merge branch 'v8.5' into v8.6
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 42f65dfb5..008d5cf9f 100644 --- a/toplevel/metasyntax.ml +++ b/toplevel/metasyntax.ml @@ -1093,7 +1093,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 |