From 316ae01c16db690a972fcba9ce735818a31773ac Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Mon, 13 Jun 2022 14:02:54 -0400 Subject: Specify []; spec is now a version 1.0 draft --- docs/spec/grammar.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'docs/spec/grammar.html') diff --git a/docs/spec/grammar.html b/docs/spec/grammar.html index 139a5dd4..c7212568 100644 --- a/docs/spec/grammar.html +++ b/docs/spec/grammar.html @@ -19,8 +19,9 @@ _mod2_ = ( atom "." )? _c_ | _cl_ | "(" _m2Expr_ ")" | _blMod2_ _mod1 = ( atom "." )? _m | _ml | "(" _m1Expr ")" | _blMod1 Func = ( atom "." )? F | Fl | "(" FuncExpr ")" | BlFunc -atom = ( atom "." )? s | sl | "(" subExpr ")" | blSub | list -list = "⟨" ? ( ( EXPR )* EXPR ? )? "⟩" +atom = ( atom "." )? s | sl | "(" subExpr ")" | blSub | array +array = "⟨" ? ( ( EXPR )* EXPR ? )? "⟩" + | "[" ? ( EXPR )* EXPR ? "]" subject = atom | ANY ( "‿" ANY )+

Starting at the highest-order objects, modifiers have simple syntax. In most cases the syntax for and is the same, but only can be used for modified assignment. The export arrow can be used in the same ways as , but it can also be used at the beginning of a header to force a namespace result, or with no expression on the right in an EXPORT statement.

@@ -55,13 +56,14 @@

The target of subject assignment can be compound to allow for destructuring. List and namespace assignment share the nodes lhsList and lhsStr and cannot be completely distinguished until execution. The term sl in LHS_SUB is used for header inputs below: as an additional rule, it cannot be used in the lhs term of a subExpr node.

NAME     = s | F | _m | _c_
-LHS_SUB  = "·" | lhsList | sl
+LHS_SUB  = "·" | lhsList | lhsArray | sl
 LHS_ANY  = NAME | LHS_SUB | "(" LHS_ELT ")"
 LHS_ATOM = LHS_ANY | "(" lhsStr ")"
 LHS_ELT  = LHS_ANY | lhsStr
 LHS_ENTRY= LHS_ELT | lhs "⇐" NAME
 lhsStr   = LHS_ATOM ( "‿" LHS_ATOM )+
 lhsList  = "⟨" ? ( ( LHS_ENTRY  )* LHS_ENTRY ? )? "⟩"
+lhsArray = "[" ?   ( LHS_ELT    )* LHS_ELT   ?    "]"
 lhsComp  = LHS_SUB | lhsStr | "(" lhs ")"
 lhs      = s | lhsComp
 
-- cgit v1.2.3