@@ -109,18 +109,18 @@ \subsection{Creating AST Objects \label{Creating ASTs}}
109109
110110\begin {funcdesc }{expr}{source}
111111The \function {expr()} function parses the parameter \var {source}
112- as if it were an input to \samp {compile(\var {source}, 'eval' )}. If
113- the parse succeeds, an AST object is created to hold the internal
114- parse tree representation, otherwise an appropriate exception is
115- thrown.
112+ as if it were an input to \samp {compile(\var {source}, 'file.py' ,
113+ 'eval' )}. If the parse succeeds, an AST object is created to hold the
114+ internal parse tree representation, otherwise an appropriate exception
115+ is thrown.
116116\end {funcdesc }
117117
118118\begin {funcdesc }{suite}{source}
119119The \function {suite()} function parses the parameter \var {source}
120- as if it were an input to \samp {compile(\var {source}, 'exec' )}. If
121- the parse succeeds, an AST object is created to hold the internal
122- parse tree representation, otherwise an appropriate exception is
123- thrown.
120+ as if it were an input to \samp {compile(\var {source}, 'file.py' ,
121+ 'exec' )}. If the parse succeeds, an AST object is created to hold the
122+ internal parse tree representation, otherwise an appropriate exception
123+ is thrown.
124124\end {funcdesc }
125125
126126\begin {funcdesc }{sequence2ast}{sequence}
@@ -323,7 +323,7 @@ \subsubsection{Emulation of \function{compile()}}
323323intermediate data structure is equivalent to the code
324324
325325\begin {verbatim }
326- >>> code = compile('a + 5', 'eval')
326+ >>> code = compile('a + 5', 'file.py', ' eval')
327327>>> a = 5
328328>>> eval(code)
32932910
@@ -336,7 +336,7 @@ \subsubsection{Emulation of \function{compile()}}
336336\begin {verbatim }
337337>>> import parser
338338>>> ast = parser.expr('a + 5')
339- >>> code = ast.compile()
339+ >>> code = ast.compile('file.py' )
340340>>> a = 5
341341>>> eval(code)
34234210
0 commit comments