on master help sign in
Fix FLOATOP properly
commitef3aed211a2e9dfd366277c223561b111cb08015 authorEdwin Brady <eb@cs.st-andrews.ac.uk> dateSun 23 Sep 2012, 18:32 (14 years ago) parent973e014
3 files changed+8−3
rts/idris_rts.h+1−1 src/Core/Elaborate.hs+6−1 src/Idris/ElabTerm.hs+1−1
rts/idris_rts.h+1−1
@@ -98,7 +98,7 @@ typedef intptr_t i_int;
9898#define ISINT(x) ((((i_int)x)&1) == 1)
9999
100100#define INTOP(op,x,y) MKINT((i_int)((((i_int)x)>>1) op (((i_int)y)>>1)))
101−#define FLOATOP(op,x,y) MKFLOAT(((GETFLOAT(x)) op (GETFLOAT(y))))
101+#define FLOATOP(op,x,y) MKFLOAT(vm, ((GETFLOAT(x)) op (GETFLOAT(y))))
102102#define FLOATBOP(op,x,y) MKINT((i_int)(((GETFLOAT(x)) op (GETFLOAT(y)))))
103103#define ADD(x,y) (void*)(((i_int)x)+(((i_int)y)-1))
104104#define MULT(x,y) (MKINT((((i_int)x)>>1) * (((i_int)y)>>1)))
src/Core/Elaborate.hs+6−1
@@ -441,7 +441,12 @@ try t1 t2 = do s <- get
441441 Error e2 -> if score e1 > score e2
442442 then lift (tfail e1)
443443 else lift (tfail e2)
444−
444+
445+tryWhen :: Bool -> Elab' aux a -> Elab' aux a -> Elab' aux a
446+tryWhen True a b = try a b
447+tryWhen False a b = a
448+
449+
445450-- Try a selection of tactics. Exactly one must work, all others must fail
446451tryAll :: [(Elab' aux a, String)] -> Elab' aux a
447452tryAll xs = tryAll' [] (cantResolve, 0) (map fst xs)
src/Idris/ElabTerm.hs+1−1
@@ -235,7 +235,7 @@ elab ist info pattern tcgen fn tm
235235 ctxt <- get_context
236236 let guarded = isConName Nothing f ctxt
237237-- when True
238− try
238+ tryWhen True
239239 (do ns <- apply (Var f) (map isph args)
240240 let (ns', eargs)
241241 = unzip $