src/Pure/PIDE/xml.ML
changeset 47199 15ede9f1da3f
parent 46840 42e32c777581
child 48769 e3b7087bb923
equal deleted inserted replaced
47196:6012241abe93 47199:15ede9f1da3f
   325 fun list f xs = map (node o f) xs;
   325 fun list f xs = map (node o f) xs;
   326 
   326 
   327 fun option _ NONE = []
   327 fun option _ NONE = []
   328   | option f (SOME x) = [node (f x)];
   328   | option f (SOME x) = [node (f x)];
   329 
   329 
   330 fun variant fs x = [tagged (the (get_index (fn f => try f x) fs))];
   330 fun variant fs x =
       
   331   [tagged (the (get_index (fn f => SOME (f x) handle General.Match => NONE) fs))];
   331 
   332 
   332 end;
   333 end;
   333 
   334 
   334 
   335 
   335 structure Decode =
   336 structure Decode =