|
@@ -1196,7 +1196,7 @@ def exp(e):
|
|
|
|
|
|
def stmt(s):
|
|
def stmt(s):
|
|
match s:
|
|
match s:
|
|
- case Call(Name('print'), [e]):
|
|
|
|
|
|
+ case Expr(Call(Name('print'), [e])):
|
|
return exp(e)
|
|
return exp(e)
|
|
case Expr(e):
|
|
case Expr(e):
|
|
return exp(e)
|
|
return exp(e)
|
|
@@ -1709,7 +1709,7 @@ exhibit several compilation techniques.
|
|
{\if\edition\pythonEd
|
|
{\if\edition\pythonEd
|
|
\[
|
|
\[
|
|
\begin{array}{rcl}
|
|
\begin{array}{rcl}
|
|
- \Exp &::=& \Int \MID \key{input\_int}\LP\RP \MID \key{-}\;\Exp \MID \Exp \; \key{+} \; \Exp \MID \Var{} \\
|
|
|
|
|
|
+ \Exp &::=& \Int \MID \key{input\_int}\LP\RP \MID \key{-}\;\Exp \MID \Exp \; \key{+} \; \Exp \MID \LP\Exp\RP \MID \Var{} \\
|
|
\Stmt &::=& \key{print}\LP \Exp \RP \MID \Exp \MID \Var\mathop{\key{=}}\Exp\\
|
|
\Stmt &::=& \key{print}\LP \Exp \RP \MID \Exp \MID \Var\mathop{\key{=}}\Exp\\
|
|
\LangVarM{} &::=& \Stmt^{*}
|
|
\LangVarM{} &::=& \Stmt^{*}
|
|
\end{array}
|
|
\end{array}
|