mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-28 14:02:50 -06:00
added test cases for computation with abstract syntax terms
This commit is contained in:
28
testsuite/runtime/eval/Test.gf
Normal file
28
testsuite/runtime/eval/Test.gf
Normal file
@@ -0,0 +1,28 @@
|
||||
abstract Test = {
|
||||
|
||||
fun f : Int -> Int -> Int ;
|
||||
|
||||
fun g : Int -> Int ;
|
||||
def g 1 = 2 ;
|
||||
|
||||
fun g2 : Int -> Int -> Int ;
|
||||
def g2 1 x = x ;
|
||||
|
||||
fun g0 : Int -> Int -> Int ;
|
||||
def g0 = g2 ;
|
||||
|
||||
fun const : Int -> Int -> Int ;
|
||||
def const x _ = x ;
|
||||
|
||||
cat Nat ;
|
||||
|
||||
data zero : Nat ;
|
||||
succ : Nat -> Nat ;
|
||||
err : Nat ;
|
||||
|
||||
fun dec : Nat -> Nat ;
|
||||
def dec zero = zero ;
|
||||
dec (succ n) = n ;
|
||||
dec n = err ; -- for fall through checking
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user