[Python-checkins] CVS: python/dist/src/Doc/lib libparser.tex,1.34,1.35

Fred Drake python-dev@python.org
Tue, 9 May 2000 13:10:26 -0400


Update of /projects/cvsroot/python/dist/src/Doc/lib
In directory seahag.cnri.reston.va.us:/home/fdrake/projects/python/Doc/lib
Modified Files:
	libparser.tex 
Log Message:
Fix references to the built-in compile() that don't include the
filename parameter. Noted by Randall Hopper <aa8vb@yahoo.com>.
Index: libparser.tex
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Doc/lib/libparser.tex,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -r1.34 -r1.35
*** libparser.tex	2000年04月03日 20:13:53	1.34
--- libparser.tex	2000年05月09日 17:10:23	1.35
***************
*** 110,125 ****
 \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.
 \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.
 \end{funcdesc}
 
--- 110,125 ----
 \begin{funcdesc}{expr}{source}
 The \function{expr()} function parses the parameter \var{source}
! 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}, '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}
 
***************
*** 324,328 ****
 
 \begin{verbatim}
! >>> code = compile('a + 5', 'eval')
 >>> a = 5
 >>> eval(code)
--- 324,328 ----
 
 \begin{verbatim}
! >>> code = compile('a + 5', 'file.py', 'eval')
 >>> a = 5
 >>> eval(code)
***************
*** 337,341 ****
 >>> import parser
 >>> ast = parser.expr('a + 5')
! >>> code = ast.compile()
 >>> a = 5
 >>> eval(code)
--- 337,341 ----
 >>> import parser
 >>> ast = parser.expr('a + 5')
! >>> code = ast.compile('file.py')
 >>> a = 5
 >>> eval(code)

AltStyle によって変換されたページ (->オリジナル) /