localise (improper in PIDE) error handling preparing for transition to PIDE
authorWalther Neuper <wneuper@ist.tugraz.at>
Sat, 30 May 2015 09:40:55 +0200
changeset 59128082d228593a1
parent 59127 34f296390b60
child 59129 b5770c988153
localise (improper in PIDE) error handling preparing for transition to PIDE
src/Tools/isac/Frontend/interface.sml
     1.1 --- a/src/Tools/isac/Frontend/interface.sml	Thu May 28 14:23:18 2015 +0200
     1.2 +++ b/src/Tools/isac/Frontend/interface.sml	Sat May 30 09:40:55 2015 +0200
     1.3 @@ -378,14 +378,14 @@
     1.4  
     1.5  (* set the UContext determined on a knowledgebrowser to the current calc *)
     1.6  fun setContext (cI:calcID) (ip as (_,p_):pos') (guh:guh) =
     1.7 -  (case (implode o (take_fromto 1 4) o Symbol.explode) guh of
     1.8 +  case (implode o (take_fromto 1 4) o Symbol.explode) guh of
     1.9       "thy_" =>
    1.10  	     if member op = [Pbl,Met] p_
    1.11         then message2xml cI "thy-context not to calchead"
    1.12         else if ip = ([],Res) then message2xml cI "no thy-context at result"
    1.13  	     else if no_thycontext guh then message2xml cI ("no thy-context for '" ^ guh ^ "'")
    1.14    	   else
    1.15 -         let
    1.16 +         ((let
    1.17             val (ptp as (pt, pold), _) = get_calc cI
    1.18  		       val is = get_istate pt ip
    1.19  		       val subs = subs_from is "dummy" guh
    1.20 @@ -412,8 +412,9 @@
    1.21  	                  autocalculateOK2xml cI pold (if null c then pold else last_elem c) p
    1.22  		  	            end)
    1.23  	       end
    1.24 +      )handle _ => sysERROR2xml cI "setContext: thy_ ???")
    1.25     | "pbl_" =>
    1.26 -	     let
    1.27 +	     ((let
    1.28           val pI = guh2kestoreID guh
    1.29  	       val ((pt, _), _) = get_calc cI
    1.30  	       in
    1.31 @@ -423,18 +424,19 @@
    1.32  		         in (upd_calc cI ((pt, ip), []); modifycalcheadOK2xml cI chd) end
    1.33  	         else sysERROR2xml cI "setContext for pbl requires ActiveFormula on CalcHead"
    1.34  	     end
    1.35 +      )handle _ => sysERROR2xml cI "setContext: pbl_ ???")
    1.36     | "met_" =>
    1.37 -	     let
    1.38 +	     ((let
    1.39           val mI = guh2kestoreID guh
    1.40  	       val ((pt, _), _) = get_calc cI
    1.41  	       in
    1.42             if member op = [Pbl, Met] p_
    1.43 -	         then
    1.44 +	         then            
    1.45               let val (pt, chd) = set_method mI (pt, ip)
    1.46  		         in (upd_calc cI ((pt, ip), []); modifycalcheadOK2xml cI chd) end
    1.47  	         else sysERROR2xml cI "setContext for met requires ActiveFormula on CalcHead"
    1.48 -	       end)
    1.49 -   handle _ => sysERROR2xml cI "error in kernel";
    1.50 +	       end
    1.51 +      )handle _ => sysERROR2xml cI "setContext: met_ ???")
    1.52  
    1.53  
    1.54  (*.specify the Method at the activeFormula and return a CalcHead