src/Tools/WWW_Find/unicode_symbols.ML
changeset 36960 01594f816e3a
parent 36692 54b64d4ad524
child 40527 e0c000e40c05
equal deleted inserted replaced
36959:f5417836dbea 36960:01594f816e3a
   112 
   112 
   113 end;
   113 end;
   114 
   114 
   115 local (* Parser *)
   115 local (* Parser *)
   116 
   116 
   117 structure P = OuterParse;
       
   118 
       
   119 fun $$$ kw = Scan.one (is_keyword kw) >> str_of_token;
   117 fun $$$ kw = Scan.one (is_keyword kw) >> str_of_token;
   120 val hex_code = Scan.one is_hex_code >> int_of_code;
   118 val hex_code = Scan.one is_hex_code >> int_of_code;
   121 val ascii_sym = Scan.one is_ascii_sym >> str_of_token;
   119 val ascii_sym = Scan.one is_ascii_sym >> str_of_token;
   122 val symbol = Scan.one is_symbol >> (fn t => (str_of_token t, pos_of_token t));
   120 val symbol = Scan.one is_symbol >> (fn t => (str_of_token t, pos_of_token t));
   123 val name = Scan.one is_name >> str_of_token;
   121 val name = Scan.one is_name >> str_of_token;
   127 val abbr = Scan.option ($$$ "abbrev" -- $$$ ":"
   125 val abbr = Scan.option ($$$ "abbrev" -- $$$ ":"
   128                         |-- (ascii_sym || $$$ ":" || name));
   126                         |-- (ascii_sym || $$$ ":" || name));
   129 
   127 
   130 in
   128 in
   131 
   129 
   132 val line = (symbol -- unicode --| font -- abbr) >> P.triple1;
   130 val line = (symbol -- unicode --| font -- abbr) >> Parse.triple1;
   133 
   131 
   134 val symbols_path =
   132 val symbols_path =
   135   [getenv "ISABELLE_HOME", "etc", "symbols"]
   133   [getenv "ISABELLE_HOME", "etc", "symbols"]
   136   |> map Path.explode
   134   |> map Path.explode
   137   |> Path.appends;
   135   |> Path.appends;