Explorar el Código

allow all escape chars (close #5312)

Nicolas Cannasse hace 8 años
padre
commit
412057540f
Se han modificado 2 ficheros con 4 adiciones y 2 borrados
  1. 2 1
      src/generators/hlinterp.ml
  2. 2 1
      src/macro/interp.ml

+ 2 - 1
src/generators/hlinterp.ml

@@ -1937,7 +1937,8 @@ let load_native ctx lib name t =
 						| '1'..'9' | '+' | '$' | '^' | '*' | '?' | '.' | '[' | ']' ->
 							Buffer.add_char buf '\\';
 							Buffer.add_char buf c;
-						| _ -> failwith ("Unsupported escaped char '" ^ String.make 1 c ^ "'"));
+						| _ ->
+							Buffer.add_char buf c);
 						loop c false l
 					| c :: l ->
 						match c with

+ 2 - 1
src/macro/interp.ml

@@ -1963,7 +1963,8 @@ let reg_lib =
 						| '1'..'9' | '+' | '$' | '^' | '*' | '?' | '.' | '[' | ']' ->
 							Buffer.add_char buf '\\';
 							Buffer.add_char buf c;
-						| _ -> failwith ("Unsupported escaped char '" ^ String.make 1 c ^ "'"));
+						| _ ->
+							Buffer.add_char buf c);
 						loop c false l
 					| c :: l ->
 						match c with