Commit 427ac865 authored by POTTIER Francois's avatar POTTIER Francois

Updated [PartialGrammar.restrict].

parent 6f924d63
......@@ -242,12 +242,12 @@ let is_valid_nonterminal_character = function
false
let restrict filename =
let m = String.copy (Filename.chop_suffix filename (if Settings.coq then ".vy" else ".mly")) in
for i = 0 to String.length m - 1 do
if not (is_valid_nonterminal_character m.[i]) then
m.[i] <- '_'
let m = Bytes.of_string (Filename.chop_suffix filename (if Settings.coq then ".vy" else ".mly")) in
for i = 0 to Bytes.length m - 1 do
if not (is_valid_nonterminal_character (Bytes.get m i)) then
Bytes.set m i '_'
done;
m
Bytes.unsafe_to_string m
let rename nonterminal filename =
let name = restrict filename ^ "_" ^ nonterminal in
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment