@@ -48,10 +48,13 @@ also be used to include reserved words in syntax rules, such as \texttt{"let"} o
48\end{itemize}
48\end{itemize}
51−The limitations on the form of a syntax rule are that it must include at least one
51+The limitations on the form of a syntax rule are that it must include at least
52−symbol or keyword, and there must be no repeated variables standing for non-terminals.
52+one symbol or keyword, and there must be no repeated variables standing for
53+non-terminals. Any expression can be used, but if there are two non-terminals
54+in a row in a rule, only simple expressions may be used (that is, variables,
53−Rules can use previously defined rules, but may not be recursive.
55+constants, or bracketed expressions). Rules can use previously defined rules,
54−The following syntax extensions would therefore be valid:
56+but may not be recursive. The following syntax extensions would therefore be
56\begin{SaveVerbatim}{syntaxex}
59\begin{SaveVerbatim}{syntaxex}
@@ -100,10 +103,10 @@ exampe, a \texttt{for} loop binds a variable on each iteration:
101\begin{SaveVerbatim}{forloop}
104\begin{SaveVerbatim}{forloop}
103−syntax for {x} "in" [xs] [body] = forLoop xs (\x => body)
106+syntax for {x} "in" [xs] ":" [body] = forLoop xs (\x => body)
105main : IO ()
108main : IO ()
106−main = do for x in [1..10] do
109+main = do for x in [1..10]:
107 putStrLn ("Number " ++ show x)
110 putStrLn ("Number " ++ show x)
108 putStrLn "Done!"
111 putStrLn "Done!"