Commit 09f79172 authored by Robert Bradshaw's avatar Robert Bradshaw

Use our copy of the grammar.

parent 33d6f76f
...@@ -4,6 +4,7 @@ try: ...@@ -4,6 +4,7 @@ try:
except ImportError: except ImportError:
from distutils.core import setup, Extension from distutils.core import setup, Extension
import os import os
import stat
import subprocess import subprocess
import sys import sys
...@@ -128,18 +129,17 @@ def compile_cython_modules(profile=False, compile_more=False, cython_with_refnan ...@@ -128,18 +129,17 @@ def compile_cython_modules(profile=False, compile_more=False, cython_with_refnan
print "Unable to find pgen, not compiling formal grammar." print "Unable to find pgen, not compiling formal grammar."
else: else:
parser_dir = os.path.join(os.path.dirname(__file__), 'Cython', 'Parser') parser_dir = os.path.join(os.path.dirname(__file__), 'Cython', 'Parser')
print ' '.join([ grammar = os.path.join(parser_dir, 'Grammar')
pgen,
os.path.join(get_python_inc(), '..', 'Grammar', 'Grammar'),
os.path.join(parser_dir, 'graminit.h'),
os.path.join(parser_dir, 'graminit.c'),
])
subprocess.check_call([ subprocess.check_call([
pgen, pgen,
os.path.join(get_python_inc(), '..', 'Grammar', 'Grammar'), os.path.join(grammar),
os.path.join(parser_dir, 'graminit.h'), os.path.join(parser_dir, 'graminit.h'),
os.path.join(parser_dir, 'graminit.c'), os.path.join(parser_dir, 'graminit.c'),
]) ])
cst_pyx = os.path.join(parser_dir, 'ConcreteSyntaxTree.pyx')
if os.stat(grammar)[stat.ST_MTIME] > os.stat(cst_pyx)[stat.ST_MTIME]:
mtime = os.stat(grammar)[stat.ST_MTIME]
os.utime(cst_pyx, (mtime, mtime))
compiled_modules.extend([ compiled_modules.extend([
"Cython.Parser.ConcreteSyntaxTree", "Cython.Parser.ConcreteSyntaxTree",
]) ])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment