[pypy-svn] r4340 - in pypy/trunk/src: . Pyrex Pyrex/Compiler pypy/toolpypy/translator/tool

arigo at codespeak.net arigo at codespeak.net
Sat May 8 22:03:15 CEST 2004


Author: arigo
Date: Sat May  8 22:03:14 2004
New Revision: 4340

Added:
   pypy/trunk/src/Pyrex/
      - copied from r4339, vendor/Pyrex/current/Pyrex/
   pypy/trunk/src/pypy/tool/pyrexc
      - copied, changed from r4339, vendor/Pyrex/current/bin/pyrexc
Modified:
   pypy/trunk/src/   (props changed)
   pypy/trunk/src/Pyrex/Compiler/Nodes.py
   pypy/trunk/src/Pyrex/Compiler/Parsing.py
   pypy/trunk/src/Pyrex/Compiler/Scanning.py
   pypy/trunk/src/pypy/translator/tool/buildpyxmodule.py
Log:
Switched to Pyrex 0.9.2.1.

Pyrex is now tracked in http://codespeak.net/svn/vendor/Pyrex/.
It is copied from there and modified as needed for PyPy.
The original files are:

A    Pyrex
       http://codespeak.net/svn/vendor/Pyrex/Pyrex-0.9.2.1/Pyrex/

A    pypy/tool/pyrexc
       http://codespeak.net/svn/vendor/Pyrex/Pyrex-0.9.2.1/bin/pyrexc

The external links to Pyrex and Plex have been removed.
Note that Plex is a subdirectory of Pyrex in this new version.

I guess you will have to delete your Plex directory manually; removing the
svn:externals isn't enough for svn up to delete it for you.


Modified: pypy/trunk/src/Pyrex/Compiler/Nodes.py
==============================================================================
--- vendor/Pyrex/current/Pyrex/Compiler/Nodes.py	(original)
+++ pypy/trunk/src/Pyrex/Compiler/Nodes.py	Sat May  8 22:03:14 2004
@@ -1289,6 +1289,20 @@
             self.__class__.__name__)
 
 
+class InlineStatNode(StatNode):
+    
+    def analyse_declarations(self, env):
+        pass
+    
+    def analyse_expressions(self, env):
+        pass
+    
+    def generate_execution_code(self, code):
+        code.putln(str(self.string.value))
+        #raise InternalError("generate_code not implemented for %s" % \
+        #  self.__class__.__name__)
+
+
 class CDefExternNode(StatNode):
     #  include_file   string or None
     #  body           StatNode

Modified: pypy/trunk/src/Pyrex/Compiler/Parsing.py
==============================================================================
--- vendor/Pyrex/current/Pyrex/Compiler/Parsing.py	(original)
+++ pypy/trunk/src/Pyrex/Compiler/Parsing.py	Sat May  8 22:03:14 2004
@@ -798,6 +798,14 @@
         stats.append(stat)
     return Nodes.StatListNode(pos, stats = stats)
 
+def p_cinline_statement(s):
+    # s.sy == 'cinline'
+    pos = s.position()
+    kind = s.sy
+    s.next()
+    string = p_simple_expr(s)
+    return Nodes.InlineStatNode(pos, string=string)
+
 def p_from_import_statement(s):
     # s.sy == 'from'
     pos = s.position()
@@ -1067,6 +1075,8 @@
         node = p_raise_statement(s)
     elif s.sy in ('import', 'cimport'):
         node = p_import_statement(s)
+    elif s.sy == 'cinline':
+        node = p_cinline_statement(s)
     elif s.sy == 'from':
         node = p_from_import_statement(s)
     elif s.sy == 'assert':

Modified: pypy/trunk/src/Pyrex/Compiler/Scanning.py
==============================================================================
--- vendor/Pyrex/current/Pyrex/Compiler/Scanning.py	(original)
+++ pypy/trunk/src/Pyrex/Compiler/Scanning.py	Sat May  8 22:03:14 2004
@@ -139,7 +139,7 @@
     "raise", "import", "exec", "try", "except", "finally",
     "while", "if", "elif", "else", "for", "in", "assert",
     "and", "or", "not", "is", "in", "lambda", "from",
-    "NULL", "cimport"
+    "NULL", "cimport", "cinline"
 ]
 
 class Method:

Copied: pypy/trunk/src/pypy/tool/pyrexc (from r4339, vendor/Pyrex/current/bin/pyrexc)
==============================================================================
--- vendor/Pyrex/current/bin/pyrexc	(original)
+++ pypy/trunk/src/pypy/tool/pyrexc	Sat May  8 22:03:14 2004
@@ -4,5 +4,6 @@
 #   Pyrex -- Main Program, Unix
 #
 
+import autopath
 from Pyrex.Compiler.Main import main
 main(command_line = 1)

Modified: pypy/trunk/src/pypy/translator/tool/buildpyxmodule.py
==============================================================================
--- pypy/trunk/src/pypy/translator/tool/buildpyxmodule.py	(original)
+++ pypy/trunk/src/pypy/translator/tool/buildpyxmodule.py	Sat May  8 22:03:14 2004
@@ -78,9 +78,10 @@
     try:
         options = CompilationOptions(show_version = 0, 
                                      use_listing_file = 0, 
+                                     c_only = 1,
                                      output_file = None)
         context = Context(options.include_path)
-        result = context.compile(str(pyxfile), options, c_only = 1)
+        result = context.compile(str(pyxfile), options)
         if result.num_errors > 0:
             raise ValueError, "failure %s" % result
     except PyrexError, e:


More information about the Pypy-commit mailing list