Revamp private/public functions
Problem: having public as the default makes it very easy to accidentally export local function by forgetting the `private` modifier. Solution: functions are private by default and must be declared as `entrypoint`s to be exported. So `entrypoint foo() = ...` instead of `function foo() = ...`. We still accept the `private` modifier although it is redundant.
This commit is contained in:
+1
-1
@@ -37,7 +37,7 @@ lexer() ->
|
||||
, {"[^/*]+|[/*]", skip()} ],
|
||||
|
||||
Keywords = ["contract", "include", "let", "switch", "type", "record", "datatype", "if", "elif", "else", "function",
|
||||
"stateful", "true", "false", "mod", "public", "private", "indexed", "internal", "namespace"],
|
||||
"stateful", "true", "false", "mod", "public", "entrypoint", "private", "indexed", "namespace"],
|
||||
KW = string:join(Keywords, "|"),
|
||||
|
||||
Rules =
|
||||
|
||||
Reference in New Issue
Block a user