1
1
Fork 0
mirror of https://github.com/azur1s/bobbylisp.git synced 2024-10-16 02:37:40 -05:00

Compare commits

..

No commits in common. "a07a4ab0218a9d4d455978eb4482e43443612ddc" and "0a6e04ae5fedc251de3c0d940af23c882fc994d3" have entirely different histories.

2 changed files with 6 additions and 10 deletions

2
a.hlm
View file

@ -1,4 +1,4 @@
func add (x: num) num = (\a: num -> a + 1)(x); func add x: num -> num = x + 1;
println( println(
{ {

View file

@ -446,16 +446,12 @@ pub fn stmt_parser() -> impl P<Spanned<PStmt>> {
let func = just(Token::Func) let func = just(Token::Func)
.ignore_then(symbol_parser()) .ignore_then(symbol_parser())
.then( .then(
nested_parser(
symbol_parser() symbol_parser()
.then_ignore(just(Token::Colon)) .then_ignore(just(Token::Colon))
.then(type_parser()) .then(type_parser())
.separated_by(just(Token::Comma)) .separated_by(just(Token::Comma))
.allow_trailing(),
Delim::Paren,
|_| Vec::new(),
)
) )
.then_ignore(just(Token::Arrow))
.then(type_parser()) .then(type_parser())
.then_ignore(just(Token::Assign)) .then_ignore(just(Token::Assign))
.then(expr_parser().map(Box::new)) .then(expr_parser().map(Box::new))