diff --git a/gitlab-pages/docs/language-basics/functions.md b/gitlab-pages/docs/language-basics/functions.md index 54f0d82fd..18173b545 100644 --- a/gitlab-pages/docs/language-basics/functions.md +++ b/gitlab-pages/docs/language-basics/functions.md @@ -301,13 +301,13 @@ gitlab-pages/docs/language-basics/src/functions/incr_map.religo incr_map ## Recursive function -LIGO function are not recursive by default, the user need to indicate that the function is recursive. +LIGO functions are not recursive by default, the user need to indicate that the function is recursive. At the moment, recursive function are limited to one (possibly tupled) parameter and recursion is limited to tail recursion (i.e the recursive call should be the last expression of the function) -In PascaLigo recursive funciton are defined using the "recursive" keyword +In PascaLigo recursive functions are defined using the "recursive" keyword ```pascaligo group=d recursive function sum (const n : int; const acc: int) : int is @@ -318,7 +318,7 @@ recursive function fibo (const n: int; const n_1: int; const n_0 :int) : int is ``` -In CameLigo recursive funciton are defined using the "rec" keyword +In CameLigo recursive functions are defined using the "rec" keyword ```cameligo group=d let rec sum ((n,acc):int * int) : int = @@ -329,7 +329,7 @@ let rec fibo ((n,n_1,n_0):int*int*int) : int = ``` -In ReasonLigo recursive funciton are defined using the "rec" keyword +In ReasonLigo recursive functions are defined using the "rec" keyword ```reasonligo group=d let rec sum = ((n, acc) : (int,int)): int => diff --git a/src/passes/1-parser/cameligo/Parser.mly b/src/passes/1-parser/cameligo/Parser.mly index 38c62e50a..237c08875 100644 --- a/src/passes/1-parser/cameligo/Parser.mly +++ b/src/passes/1-parser/cameligo/Parser.mly @@ -203,7 +203,7 @@ field_decl: and value = {field_name=$1; colon=$2; field_type=$3} in {region; value} } -(* Top-level non-eecursive definitions *) +(* Top-level definitions *) let_declaration: "let" ioption("rec") let_binding seq(Attr) { diff --git a/src/passes/1-parser/reasonligo/Parser.mly b/src/passes/1-parser/reasonligo/Parser.mly index 6ab0464ac..f487e306e 100644 --- a/src/passes/1-parser/reasonligo/Parser.mly +++ b/src/passes/1-parser/reasonligo/Parser.mly @@ -261,7 +261,7 @@ field_decl: and value = {field_name=$1; colon=$2; field_type=$3} in {region; value} } -(* Top-level non-recursive definitions *) +(* Top-level definitions *) let_declaration: seq(Attr) "let" ioption("rec") let_binding { diff --git a/src/passes/2-simplify/cameligo.ml b/src/passes/2-simplify/cameligo.ml index 27f661110..4e82b9d11 100644 --- a/src/passes/2-simplify/cameligo.ml +++ b/src/passes/2-simplify/cameligo.ml @@ -73,7 +73,7 @@ module Errors = struct let untyped_recursive_function var = let title () = "" in let message () = - Format.asprintf "\nUntyped recursive function \ + Format.asprintf "\nUntyped recursive functions \ are not supported yet.\n" in let param_loc = var.Region.region in let data = [