From 225a30537acfeb3efe2a7730e5d1a063cc537047 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Fri, 16 Apr 2021 20:39:10 -0400 Subject: Add return functions to the spec --- docs/spec/grammar.html | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'docs/spec/grammar.html') diff --git a/docs/spec/grammar.html b/docs/spec/grammar.html index 46509c05..9babde63 100644 --- a/docs/spec/grammar.html +++ b/docs/spec/grammar.html @@ -32,10 +32,12 @@ | Operand _mod2_ # Left partial application | _m ASGN _m1Expr -

Functions can be formed by fully applying modifiers or as trains. modifiers are left-associative, so that the left operand (Operand) can include modifier applications but the right operand (subject | Func) cannot. Trains are right-associative, but bind less tightly than modifiers. Assignment is not allowed in the top level of a train: it must be parenthesized.

+

Functions can be formed by fully applying modifiers, as trains, or with the return token โ†’, which behaves syntactically like a 1-modifier whose operand must be an identifier. Modifiers are left-associative, so that the left operand (Operand) can include modifier applications but the right operand (subject | Func) cannot. Trains are right-associative, but bind less tightly than modifiers. Assignment is not allowed in the top level of a train: it must be parenthesized.

Derv     = Func
          | Operand _mod1
          | Operand _mod2_ ( subject | Func )
+         | Return
+Return   = ( NAME | "๐•Š" | "๐•ฃ" ) "โ†’"
 Operand  = subject
          | Derv
 Fork     = Derv
@@ -51,11 +53,11 @@
          | ( subject | nothing )? Derv arg
 nothing  = "ยท"
          | ( subject | nothing )? Derv nothing
-LHS_NAME = s | F | _m | _c_
-LHS_ANY  = LHS_NAME | lhsList
+NAME     = s | F | _m | _c_
+LHS_ANY  = NAME | lhsList
 LHS_ATOM = LHS_ANY | "(" lhsStr ")"
 LHS_ELT  = LHS_ANY | lhsStr
-LHS_ENTRY= LHS_ELT | lhs "โ‡" LHS_NAME
+LHS_ENTRY= LHS_ELT | lhs "โ‡" NAME
 lhsStr   = LHS_ATOM ( "โ€ฟ" LHS_ATOM )+
 lhsList  = "โŸจ" โ‹„? ( ( LHS_ENTRY โ‹„ )* LHS_ENTRY โ‹„? )? "โŸฉ"
 lhs      = s | lhsList | lhsStr
-- 
cgit v1.2.3