mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-26 21:12:50 -06:00
extend the abstract syntax API
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
abstract basic = {
|
||||
|
||||
cat N ;
|
||||
cat N; S ;
|
||||
|
||||
fun Z : N ;
|
||||
S : N -> N ;
|
||||
fun z : N ;
|
||||
s : N -> N ;
|
||||
|
||||
fun c : N -> S ;
|
||||
|
||||
}
|
||||
|
||||
@@ -3,4 +3,10 @@ import PGF2
|
||||
|
||||
main = do
|
||||
gr <- readPGF "tests/basic.pgf"
|
||||
runTestTTAndExit (TestCase (assertEqual "abstract names" "basic" (abstractName gr)))
|
||||
runTestTTAndExit $
|
||||
TestList [TestCase (assertEqual "abstract names" "basic" (abstractName gr))
|
||||
,TestCase (assertEqual "abstract categories" ["Float","Int","N","S","String"] (categories gr))
|
||||
,TestCase (assertEqual "abstract functions" ["c","s","z"] (functions gr))
|
||||
,TestCase (assertEqual "abstract functions by cat 1" ["s","z"] (functionsByCat gr "N"))
|
||||
,TestCase (assertEqual "abstract functions by cat 2" ["c"] (functionsByCat gr "S"))
|
||||
]
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user