diff Doc/lib/libparser.tex @ 12640:3f06f4765ba4 legacy-trunk

Fix references to the built-in compile() that don't include the filename parameter. Noted by Randall Hopper <aa8vb@yahoo.com>.
author Fred Drake <fdrake@acm.org>
date Tue, 09 May 2000 17:10:23 +0000
parents e82e82b3b9ad
children fdfd1049f36e
line wrap: on
line diff
--- a/Doc/lib/libparser.tex	Tue May 09 16:23:23 2000 +0000
+++ b/Doc/lib/libparser.tex	Tue May 09 17:10:23 2000 +0000
@@ -109,18 +109,18 @@
 
 \begin{funcdesc}{expr}{source}
 The \function{expr()} function parses the parameter \var{source}
-as if it were an input to \samp{compile(\var{source}, 'eval')}.  If
-the parse succeeds, an AST object is created to hold the internal
-parse tree representation, otherwise an appropriate exception is
-thrown.
+as if it were an input to \samp{compile(\var{source}, 'file.py',
+'eval')}.  If the parse succeeds, an AST object is created to hold the
+internal parse tree representation, otherwise an appropriate exception
+is thrown.
 \end{funcdesc}
 
 \begin{funcdesc}{suite}{source}
 The \function{suite()} function parses the parameter \var{source}
-as if it were an input to \samp{compile(\var{source}, 'exec')}.  If
-the parse succeeds, an AST object is created to hold the internal
-parse tree representation, otherwise an appropriate exception is
-thrown.
+as if it were an input to \samp{compile(\var{source}, 'file.py',
+'exec')}.  If the parse succeeds, an AST object is created to hold the
+internal parse tree representation, otherwise an appropriate exception
+is thrown.
 \end{funcdesc}
 
 \begin{funcdesc}{sequence2ast}{sequence}
@@ -323,7 +323,7 @@
 intermediate data structure is equivalent to the code
 
 \begin{verbatim}
->>> code = compile('a + 5', 'eval')
+>>> code = compile('a + 5', 'file.py', 'eval')
 >>> a = 5
 >>> eval(code)
 10
@@ -336,7 +336,7 @@
 \begin{verbatim}
 >>> import parser
 >>> ast = parser.expr('a + 5')
->>> code = ast.compile()
+>>> code = ast.compile('file.py')
 >>> a = 5
 >>> eval(code)
 10