diff --git a/src/compiler/GF/Compile/GrammarToLPGF.hs b/src/compiler/GF/Compile/GrammarToLPGF.hs index 91009ef0a..52102ec18 100644 --- a/src/compiler/GF/Compile/GrammarToLPGF.hs +++ b/src/compiler/GF/Compile/GrammarToLPGF.hs @@ -103,7 +103,7 @@ mkCanon2lpgf opts gr am = do return $ L.LFTuple ts C.VariantValue [] -> return L.LFEmpty - C.VariantValue (vr:_) -> val2lin vr -- TODO variants not supported, just pick first + C.VariantValue (vr:_) -> val2lin vr -- NOTE variants not supported, just pick first C.VarValue (C.VarValueId (C.Unqual v)) -> do ix <- eitherElemIndex (C.VarId v) varIds diff --git a/testsuite/lpgf/Tables.gf b/testsuite/lpgf/Tables.gf new file mode 100644 index 000000000..fc9459a5f --- /dev/null +++ b/testsuite/lpgf/Tables.gf @@ -0,0 +1,6 @@ +abstract Tables = { + cat S ; F ; + fun + FtoS : F -> S ; + f1, f2, f3, f4, f5, f6 : F ; +} diff --git a/testsuite/lpgf/Tables.treebank b/testsuite/lpgf/Tables.treebank new file mode 100644 index 000000000..83dac48af --- /dev/null +++ b/testsuite/lpgf/Tables.treebank @@ -0,0 +1,17 @@ +Tables: FtoS f1 +TablesCnc: R1 _ + +Tables: FtoS f2 +TablesCnc: R1 _ + +Tables: FtoS f3 +TablesCnc: R1 _ + +Tables: FtoS f4 +TablesCnc: _ _ + +Tables: FtoS f5 +TablesCnc: _ Q2 + +Tables: FtoS f6 +TablesCnc: R2 Q3 diff --git a/testsuite/lpgf/TablesCnc.gf b/testsuite/lpgf/TablesCnc.gf new file mode 100644 index 000000000..b93c625df --- /dev/null +++ b/testsuite/lpgf/TablesCnc.gf @@ -0,0 +1,26 @@ +concrete TablesCnc of Tables = { + param + R = R1 | R2 ; + Q = Q3 | Q2 | Q1 ; + oper + ParamRec: Type = { r: R; q: Q } ; + lincat + S = Str ; + F = { pr : ParamRec } ; + lin + f1 = { pr = { r = R1; q = Q1 } } ; + f2 = { pr = { r = R1; q = Q2 } } ; + f3 = { pr = { r = R1; q = Q3 } } ; + f4 = { pr = { r = R2; q = Q1 } } ; + f5 = { pr = { r = R2; q = Q2 } } ; + f6 = { pr = { r = R2; q = Q3 } } ; + + FtoS f = tbl ! f.pr ; + oper + tbl = table { + { r = R1 ; q = _ } => "R1 _" ; + { r = _ ; q = Q2 } => "_ Q2" ; + { r = R2 ; q = Q3 } => "R2 Q3" ; + _ => "_ _" + } ; +} diff --git a/testsuite/lpgf/run.hs b/testsuite/lpgf/run.hs index 219e11a76..8cc1cd082 100644 --- a/testsuite/lpgf/run.hs +++ b/testsuite/lpgf/run.hs @@ -18,6 +18,7 @@ main = do doGrammar "Params" doGrammar "Walking" doGrammar "Foods" + doGrammar "Tables" doGrammar :: String -> IO () doGrammar gname = do