@@ -13,69 +13,75 @@ \section*{Changes}
1313\begin {itemize }
1414\item variable declaration
1515\item variable assignment
16- \item array/object assignment
16+ \item array assignment
1717\item \textbf {\texttt {while } } loops
1818\item \textbf {\texttt {for } } loops
1919\item \textbf {\texttt {break } } and \textbf {\texttt {continue } }
20- \item array/object access expressions
21- \item literal object expressions
22- \item dot abbreviation (see Section \textbf {Objects })
20+ \item array access expressions
2321\end {itemize }
2422
23+ \newpage
24+
2525\input source_bnf.tex
2626
2727\begin {alignat* }{9}
2828&& \textit {statement } &&\quad ::= &\quad && \textbf {\texttt {const } }\ \textit {name } \
2929 \textbf {\texttt {= } }\ \textit {expression } \ \textbf {\texttt {; } }
3030 && \textrm {constant declaration} \\
31- && && | &\quad && \textbf {\texttt {let } }\ \textit {name } \
32- \textbf {\texttt {= } }\ \textit {expression } \ \textbf {\texttt {; } }
31+ && && | &\quad && \textit {let } \ \textbf {\texttt {; } }
3332 && \textrm {variable declaration} \\
34- && && | &\quad && \textit {name } \
35- \textbf {\texttt {= } }\ \textit {expression } \ \textbf {\texttt {; } }
33+ && && | &\quad && \textit {assignment } \ \textbf {\texttt {; } }
3634 && \textrm {variable assignment} \\
3735&& && | &\quad && \textit {expression } \textbf {\texttt {[ } }
3836 \textit {expression } \textbf {\texttt {] } }
3937 \textbf {\texttt {= } }\ \textit {expression } \ \textbf {\texttt {; } }
40- && \textrm {array/object assignment} \\
38+ && \textrm {array assignment} \\
4139&& && | &\quad && \textbf {\texttt {function } }\ \textit {name } \
42- \textbf {\texttt {( } }\ \textit {parameters } \ \textbf {\texttt {) } }\\
43- && && & && \textbf {\texttt {\{ } }\ \textit {statement } \ \textbf {\texttt {\} } }
40+ \textbf {\texttt {( } }\ \textit {parameters } \ \textbf {\texttt {) } }\ \textit {block } \quad
4441 && \textrm {function declaration}\\
4542&& && | &\quad && \textbf {\texttt {return } }\ \textit {expression } \ \textbf {\texttt {; } }
4643 && \textrm {return statement}\\
4744&& && | &\quad && \textit {if-statement } \quad
4845 && \textrm {conditional statement}\\
4946&& && | &\quad && \textbf {\texttt {while } }\
50- \textbf {\texttt {( } }\ \textit {expression } \ \textbf {\texttt {) } }\ \
51- && && & && \textbf { \texttt { \{ } } \ \ textit {statement } \ \textbf { \texttt { \} } }
47+ \textbf {\texttt {( } }\ \textit {expression } \ \textbf {\texttt {) } } \
48+ \ textit {block }
5249 && \textrm {while loop}\\
53- && && | &\quad && \textbf {\texttt {for } }\
54- \textbf {\texttt {( } }\ \textit {expression } \
55- \textbf {\texttt {; } } \ \textit {expression } \
56- \textbf {\texttt {; } } \ \textit {expression } \
57- \textbf {\texttt {) } }\\
58- && && & && \textbf {\texttt {\{ } }\ \textit {statement } \ \textbf {\texttt {\} } }
50+ && && | &\quad && \textbf {\texttt {for } }\ \textbf {\texttt {( } } \
51+ (\ \textit {assignment } \ | \ \textit {let }\ ) \textbf {\texttt {; } } \\
52+ && && &\quad && \ \ \ \ \ \ \ \ \ \ \textit {expression } \ \textbf {\texttt {; } } \\
53+ && && &\quad && \ \ \ \ \ \ \ \ \ \ \textit {assignment } \ \textbf {\texttt {) } } \
54+ \textit {block }
5955 && \textrm {for loop}\\
6056&& && | &\quad && \textbf {\texttt {break } }\ \textbf {\texttt {; } }
6157 && \textrm {break statement}\\
6258&& && | &\quad && \textbf {\texttt {continue } }\ \textbf {\texttt {; } }
6359 && \textrm {continue statement}\\
6460&& && | &\quad && \textit {statement } \
6561 \textit {statement } && \textrm {statement sequence} \\
62+ && && | &\quad && \textit {block }
63+ && \textrm {block statement}\\
6664&& && | &\quad && \textit {expression } \ \textbf {\texttt {; } }
6765 && \textrm {expression statement} \\ [1mm]
6866&& \textit {parameters } && ::= &\quad && \epsilon \ | \ \textit {name } \
6967 (\ \textbf {\texttt {, } } \ \textit {name }\ )\ \ldots
7068 && \textrm {function parameters} \\ [1mm]
7169&& \textit {if-statement } && ::= &\quad && \textbf {\texttt {if } }\
7270 \textbf {\texttt {( } }\ \textit {expression } \ \textbf {\texttt {) } }\
73- \textbf { \texttt { \{ } } \ \ textit {statement } \ \textbf { \texttt { \} } } \\
71+ \textit {block } \\
7472&& && & && \textbf {\texttt {else } }\
75- (\ \textbf { \texttt { \{ } } \ \ textit {statement } \ \textbf { \texttt { \} } }
73+ (\ \textit {block }
7674 \ | \
7775 \textit {if-statement } \ )
7876 && \textrm {conditional statement} \\ [1mm]
77+ && \textit {block } && ::= & && \textbf {\texttt {\{ } }\ \textit {statement } \ \textbf {\texttt {\} } } \quad
78+ && \textrm {block statement}\\ [1mm]
79+ && \textit {let } && ::= &\quad && \textbf {\texttt {let } }\ \textit {name } \
80+ \textbf {\texttt {= } }\ \textit {expression }
81+ && \textrm {variable declaration} \\ [1mm]
82+ && \textit {assignment } && ::= &\quad && \textit {name } \
83+ \textbf {\texttt {= } }\ \textit {expression }
84+ && \textrm {variable assignment} \\ [1mm]
7985&& \textit {expression } && ::= &\quad && \textit {number } && \textrm {primitive number expression}\\
8086&& && | &\quad && \textbf {\texttt {true } }\ |\ \textbf {\texttt {false } }
8187 && \textrm {primitive boolean expression}\\
@@ -90,7 +96,7 @@ \section*{Changes}
9096&& && | &\quad && \textit {expression } \
9197 \textbf {\texttt {( } }\ \textit {expressions }\
9298 \textbf {\texttt {) } }
93- && \textrm {(compound) function application}\\
99+ && \textrm {function application}\\
94100&& && | &\quad && (\ \textit {name }\ | \
95101 \textbf {\texttt {( } }\ \textit {parameters }\ \textbf {\texttt {) } }\
96102 )\
@@ -105,11 +111,7 @@ \section*{Changes}
105111 && \textrm {empty list/array expression}\\
106112&& && | &\quad && \textit {expression } \textbf {\texttt {[ } }
107113 \textit {expression } \textbf {\texttt {] } }
108- && \textrm {array/object access} \\
109- && && | &\quad && \textbf {\texttt {\{ } }\
110- \textit {properties }\
111- \textbf {\texttt {\} } }
112- && \textrm {literal object expression}\\
114+ && \textrm {array access} \\
113115&& && | &\quad && \textbf {\texttt {( } }\ \textit {expression } \
114116 \textbf {\texttt {) } } && \textrm {parenthesised expression}\\ [1mm]
115117&& \textit {binary-operator } \
@@ -123,23 +125,19 @@ \section*{Changes}
123125 \ \textbf {\texttt {, } } \
124126 \textit {expression } \
125127 )\ \ldots
126- && \textrm {argument expressions} \\ [1mm]
127- && \textit {properties } && ::= &\quad && \epsilon \ | \ \textit {property }\ (
128- \ \textbf {\texttt {, } } \
129- \textit {property } \
130- )\ \ldots
131- && \textrm {object properties} \\ [1mm]
132- && \textit {property } && ::= &\quad && (\ \textit {string }\ |\ \textit {name }\ )
133- \ \textbf {\texttt {: } } \ \textit {expression }
134- && \textrm {object property}
128+ && \textrm {argument expressions}
135129\end {alignat* }
136130
137- \input source_return
131+ \newpage
132+
133+ \input source_return_3
138134
139135\input source_names
140136
141137\input source_lists
142138
139+ \input source_pair_mutators
140+
143141\input source_array_support
144142
145143\input source_numbers
@@ -148,8 +146,6 @@ \section*{Changes}
148146
149147\input source_arrays
150148
151- \input source_objects
152-
153149\input source_typing
154150
155151\input source_comments
0 commit comments