some special cases for official SML, to treat Isabelle symbols like raw characters;
authorwenzelm
Mon, 08 Dec 2014 15:59:30 +0100
changeset 59110 8a78c7cb5b14
parent 59109 364992cd3c50
child 59111 c85e018be3a3
some special cases for official SML, to treat Isabelle symbols like raw characters;
src/Pure/ML/ml_compiler_polyml.ML
src/Pure/ML/ml_lex.ML
--- a/src/Pure/ML/ml_compiler_polyml.ML	Mon Dec 08 15:21:57 2014 +0100
+++ b/src/Pure/ML/ml_compiler_polyml.ML	Mon Dec 08 15:59:30 2014 +0100
@@ -80,9 +80,12 @@
 
     val location_props = op ^ (YXML.output_markup (":", #props (Position.dest pos)));
 
+    val input_explode =
+      if #SML flags then String.explode
+      else maps (String.explode o Symbol.esc) o Symbol.explode;
+
     val input_buffer =
-      Unsynchronized.ref (toks |> map
-        (`(maps (String.explode o Symbol.esc) o Symbol.explode o ML_Lex.check_content_of)));
+      Unsynchronized.ref (toks |> map (`(input_explode o ML_Lex.check_content_of)));
 
     fun get () =
       (case ! input_buffer of
--- a/src/Pure/ML/ml_lex.ML	Mon Dec 08 15:21:57 2014 +0100
+++ b/src/Pure/ML/ml_lex.ML	Mon Dec 08 15:59:30 2014 +0100
@@ -295,7 +295,10 @@
 
 fun gen_read SML pos text =
   let
-    val syms = Symbol_Pos.explode (text, pos);
+    val syms =
+      Symbol_Pos.explode (text, pos)
+      |> SML ? maps (fn (s, p) => raw_explode s |> map (rpair p));
+
     val termination =
       if null syms then []
       else