diff options
| author | hallgren <hallgren@chalmers.se> | 2015-09-28 22:23:56 +0000 |
|---|---|---|
| committer | hallgren <hallgren@chalmers.se> | 2015-09-28 22:23:56 +0000 |
| commit | 35be1828241bb8dacdf326810af388b7b349e591 (patch) | |
| tree | 78ff946a0726e39c7eb5d871d903b9bdcd06520a /src/compiler/GF/Compile/Compute/Predef.hs | |
| parent | 82f238fe2b418a715fef52abc7136551fa535aac (diff) | |
Preliminary new shell feature: cc -trace.
You can now do things like
cc -trace mkV "debug"
to see a trace of all opers with their arguments and results during the
computation of mkV "debug".
Diffstat (limited to 'src/compiler/GF/Compile/Compute/Predef.hs')
| -rw-r--r-- | src/compiler/GF/Compile/Compute/Predef.hs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/compiler/GF/Compile/Compute/Predef.hs b/src/compiler/GF/Compile/Compute/Predef.hs index 0900f3665..0e02402f7 100644 --- a/src/compiler/GF/Compile/Compute/Predef.hs +++ b/src/compiler/GF/Compile/Compute/Predef.hs @@ -75,7 +75,7 @@ predefList = (cIsUpper,IsUpper),(cLength,Length),(cPlus,Plus),(cEqInt,EqInt), (cLessInt,LessInt), -- cShow, cRead, cMapStr, cEqVal - (cError,Error), + (cError,Error),(cTrace,Trace), -- Canonical values: (cPBool,PBool),(cPFalse,PFalse),(cPTrue,PTrue),(cInt,Int), (cInts,Ints),(cNonExist,NonExist) @@ -101,6 +101,7 @@ delta f vs = LessInt -> ap2 ((<)::Int->Int->Bool) {- -- | Show | Read | ToStr | MapStr | EqVal -} Error -> ap1 VError + Trace -> ap2 vtrace -- Canonical values: PBool -> canonical Int -> canonical @@ -129,6 +130,9 @@ delta f vs = | null [v | v@(VApp NonExist _) <- vs] = b | otherwise = return (toValue a) + vtrace :: Value -> Value -> Value + vtrace x y = y -- tracing is implemented elsewhere + -- unimpl id = bug $ "unimplemented predefined function: "++showIdent id -- problem id vs = bug $ "unexpected arguments: Predef."++showIdent id++" "++show vs |
