From 0d55483321999757a22e568902b351118e438d84 Mon Sep 17 00:00:00 2001 From: collin Date: Wed, 8 Jul 2020 22:08:20 -0700 Subject: [PATCH] allow newlines in function def --- ast/src/leo.pest | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ast/src/leo.pest b/ast/src/leo.pest index f125c2ae24..7488e56230 100644 --- a/ast/src/leo.pest +++ b/ast/src/leo.pest @@ -302,11 +302,11 @@ statement_return = { "return " ~ return_} /// Functions // Declared in functions/function.rs -function_definition = { "function " ~ identifier ~ "(" ~ input_model_list ~ ")" ~ ("->" ~ (type_ | "(" ~ type_list ~ ")"))? ~ "{" ~ NEWLINE* ~ statement* ~ NEWLINE* ~ "}" ~ NEWLINE* } +function_definition = { "function " ~ identifier ~ "(" ~ NEWLINE* ~ input_model_list ~ NEWLINE* ~ ")" ~ ("->" ~ (type_ | "(" ~ type_list ~ ")"))? ~ "{" ~ NEWLINE* ~ statement* ~ NEWLINE* ~ "}" ~ NEWLINE* } // Declared in functions/function_input.rs function_input = { mutable? ~ identifier ~ ":" ~ type_ } -input_model_list = _{ (function_input ~ ("," ~ function_input)*)? } +input_model_list = _{ (function_input ~ ("," ~ NEWLINE* ~ function_input)*)? } // Declared in functions/test_function.rs test_function = { "test " ~ function_definition }