You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
946 B
Plaintext

Declaration with types test
======
let a: Num = 1 + 1
let add_a x: Num -> Num = x + a
======
(file
(statement
(decl
(ident: "a")
(type_annot
(type_expr
(type_ident
(type_name: "Num")
)
)
)
(expr
(infix_expr
(literal
(integer: "1")
)
(operator: "+")
(literal
(integer: "1")
)
)
)
)
)
(statement
(decl
(ident: "add_a")
(ident: "x")
(type_annot
(type_expr
(func
(type_ident
(type_name: "Num")
)
(type_expr
(type_ident
(type_name: "Num")
)
)
)
)
)
(expr
(infix_expr
(ident: "x")
(operator: "+")
(ident: "a")
)
)
)
)
(EOI: "")
)