From 655576c291317ec1f38aa396d72cb0efd039fbe5 Mon Sep 17 00:00:00 2001 From: krangelov Date: Fri, 3 Dec 2021 15:00:04 +0100 Subject: [PATCH] the variable labeling should start with 0. --- src/compiler/GF/Compile/Compute/Concrete.hs | 2 +- src/compiler/GF/Compile/GeneratePMCFG.hs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/GF/Compile/Compute/Concrete.hs b/src/compiler/GF/Compile/Compute/Concrete.hs index d40455228..d02d90203 100644 --- a/src/compiler/GF/Compile/Compute/Concrete.hs +++ b/src/compiler/GF/Compile/Compute/Concrete.hs @@ -641,7 +641,7 @@ getVariables = EvalM $ \gr k mt r -> do Ok ts -> length ts Bad msg -> error msg params <- metas2params gr tnks - return ((i,range):params) + return ((i-1,range):params) _ -> metas2params gr tnks getRef tnk = EvalM $ \gr k mt r -> readSTRef tnk >>= \st -> k st mt r diff --git a/src/compiler/GF/Compile/GeneratePMCFG.hs b/src/compiler/GF/Compile/GeneratePMCFG.hs index 746717adc..6efe59fe1 100644 --- a/src/compiler/GF/Compile/GeneratePMCFG.hs +++ b/src/compiler/GF/Compile/GeneratePMCFG.hs @@ -165,7 +165,7 @@ param2int (VMeta tnk _ _) = do Evaluated v -> param2int v Narrowing j ty -> do let QC q = valTypeCnc ty (_,ResParam _ (Just (_,cnt))) <- getInfo q - return (0,[(1,j)],cnt) + return (0,[(1,j-1)],cnt) param2int v = do t <- value2term 0 v evalError ("the parameter:" <+> ppTerm Unqualified 0 t $$ "cannot be evaluated at compile time.")