From 83e23b6b449112f4a85d09c57e5601faa87856ca Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Mon, 2 Nov 2020 12:27:17 -0700 Subject: add function declarations --- language/functions.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 language/functions.rst (limited to 'language/functions.rst') diff --git a/language/functions.rst b/language/functions.rst new file mode 100644 index 0000000..86d1144 --- /dev/null +++ b/language/functions.rst @@ -0,0 +1,20 @@ +Functions +--------- + +.. crowbar:element:: FunctionDeclaration <- FunctionSignature ';' + + A function declaration defines the return type, name, and arguments of a function without specifying its behavior. + It is generally used as part of an API boundary. + +.. crowbar:element:: FunctionDefinition <- FunctionSignature Block + + A function definition provides the actual behavior of a function, which may have been declared previously or may not. + + .. todo:: + + define function linkage/exportedness + +.. crowbar:element:: FunctionSignature <- Type identifier '(' SignatureArguments? ')' + SignatureArguments <- Type identifier (',' Type identifier)* ','? + + A function signature specifies the return type, name, and arguments of a function. -- cgit v1.2.3