Skip to content

Commit 148e920

Browse files
committed
address pr comments remove matrix subscript grammar, update accessor grammar to be inclusive to swizzling, and simplify memory style accessor description.
1 parent ca49f79 commit 148e920

File tree

1 file changed

+22
-9
lines changed

1 file changed

+22
-9
lines changed

specs/language/expressions.tex

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -169,22 +169,35 @@
169169

170170
\Sec{Matrix Member Expression(s)}{Expr.Post.Member.Matrix}
171171
\begin{grammar}
172-
\define{postfix-expression}\br
173-
primary-expression\br
174-
postfix-expression [ expression ][ expression ]\br %
175-
postfix-expression matrix-zero-indexed-accessor\br
176-
postfix-expression matrix-one-indexed-accessor\br
172+
\define {matrix-accessor-sequence}\br
173+
matrix-zero-indexed-accessor-sequence\br
174+
matrix-one-indexed-accessor-sequence\br
175+
176+
\define{matrix-zero-indexed-accessor-sequence}\br
177+
matrix-zero-indexed-accessor\br
178+
matrix-zero-indexed-accessor-sequence matrix-zero-indexed-accessor\br
179+
177180
\define{matrix-zero-indexed-accessor}\br
178-
\opt{matrix-zero-indexed-accessor} \terminal{\_m} integer-literal\br
181+
\terminal{\_m} zero-index-value\br
182+
183+
\define{zero-index-value}\br
184+
\terminal{0 1 2 3 }\br
185+
186+
\define{matrix-one-indexed-accessor-sequence}\br
187+
matrix-one-indexed-accessor\br
188+
matrix-one-indexed-accessor-sequence matrix-one-indexed-accessor\br
189+
179190
\define{matrix-one-indexed-accessor}\br
180-
\opt{matrix-one-indexed-accessor} \terminal{\_} integer-literal\br
191+
\terminal{\_m} one-index-value\br
192+
193+
\define{one-index-value}\br
194+
\terminal{1 2 3 4 }\br
181195
\end{grammar}
182196
\begin{itemize}
183197
\item \textbf{.\_} (math-style): subsequent subscripts use \textbf{1-based}
184198
indexing for both row and column.
185199
\item \textbf{.\_m} (memory-style): subsequent subscripts use \textbf{0-based}
186-
indexing for both row and column. This is equivalent to the double square
187-
brackets subscript expression of the form \texttt{E0[E1][E2]}.
200+
indexing for both row and column.
188201
\end{itemize}
189202

190203
\Sec{Function Calls}{Expr.Post.Call}

0 commit comments

Comments
 (0)