Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
2bfc211b
Commit
2bfc211b
authored
Jun 07, 2008
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
last merge broke the compiler, here are some initial fixes
parent
5449f98b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
7 deletions
+10
-7
Cython/Compiler/Main.py
Cython/Compiler/Main.py
+5
-5
Cython/Compiler/Scanning.py
Cython/Compiler/Scanning.py
+5
-2
No files found.
Cython/Compiler/Main.py
View file @
2bfc211b
...
...
@@ -108,7 +108,7 @@ class Context:
if
debug_find_module
:
print
(
"Context.find_module: Parsing %s"
%
pxd_pathname
)
source_desc
=
FileSourceDescriptor
(
pxd_pathname
)
pxd_tree
=
self
.
parse
(
source_desc
,
scope
.
type_names
,
pxd
=
1
,
pxd_tree
=
self
.
parse
(
source_desc
,
scope
,
pxd
=
1
,
full_module_name
=
module_name
)
pxd_tree
.
analyse_declarations
(
scope
)
except
CompileError
:
...
...
@@ -242,7 +242,7 @@ class Context:
self
.
modules
[
name
]
=
scope
return
scope
def
parse
(
self
,
source_desc
,
type_names
,
pxd
,
full_module_name
):
def
parse
(
self
,
source_desc
,
scope
,
pxd
,
full_module_name
):
if
not
isinstance
(
source_desc
,
FileSourceDescriptor
):
raise
RuntimeError
(
"Only file sources for code supported"
)
source_filename
=
Utils
.
encode_filename
(
source_desc
.
filename
)
...
...
@@ -251,7 +251,7 @@ class Context:
f
=
Utils
.
open_source_file
(
source_filename
,
"rU"
)
try
:
s
=
PyrexScanner
(
f
,
source_desc
,
source_encoding
=
f
.
encoding
,
type_names
=
type_names
,
context
=
self
)
scope
=
scope
,
context
=
self
)
tree
=
Parsing
.
p_module
(
s
,
pxd
,
full_module_name
)
finally
:
f
.
close
()
...
...
@@ -304,7 +304,7 @@ class Context:
c_suffix
=
".cpp"
else
:
c_suffix
=
".c"
result
.
c_file
=
Utils
.
replace_suffix
(
source
,
c_suffix
)
result
.
c_file
=
Utils
.
replace_suffix
(
source
,
c_suffix
)
c_stat
=
None
if
result
.
c_file
:
try
:
...
...
@@ -317,7 +317,7 @@ class Context:
scope
=
self
.
find_module
(
module_name
,
pos
=
initial_pos
,
need_pxd
=
0
)
errors_occurred
=
False
try
:
tree
=
self
.
parse
(
source
,
scope
.
type_names
,
pxd
=
0
,
tree
=
self
.
parse
(
source
,
scope
,
pxd
=
0
,
full_module_name
=
full_module_name
)
tree
.
process_implementation
(
scope
,
options
,
result
)
except
CompileError
:
...
...
Cython/Compiler/Scanning.py
View file @
2bfc211b
...
...
@@ -281,23 +281,26 @@ class StringSourceDescriptor(SourceDescriptor):
class
PyrexScanner
(
Scanner
):
# context Context Compilation context
# type_names set Identifiers to be treated as type names
# included_files [string] Files included with 'include' statement
# compile_time_env dict Environment for conditional compilation
# compile_time_eval boolean In a true conditional compilation context
# compile_time_expr boolean In a compile-time expression context
resword_dict
=
build_resword_dict
()
def
__init__
(
self
,
file
,
filename
,
parent_scanner
=
None
,
type_names
=
None
,
context
=
None
,
source_encoding
=
None
):
scope
=
None
,
context
=
None
,
source_encoding
=
None
):
Scanner
.
__init__
(
self
,
get_lexicon
(),
file
,
filename
)
if
parent_scanner
:
self
.
context
=
parent_scanner
.
context
self
.
type_names
=
parent_scanner
.
type_names
self
.
included_files
=
parent_scanner
.
included_files
self
.
compile_time_env
=
parent_scanner
.
compile_time_env
self
.
compile_time_eval
=
parent_scanner
.
compile_time_eval
self
.
compile_time_expr
=
parent_scanner
.
compile_time_expr
else
:
self
.
context
=
context
self
.
type_names
=
type_names
self
.
type_names
=
scope
.
type_names
self
.
included_files
=
scope
.
included_files
self
.
compile_time_env
=
initial_compile_time_env
()
self
.
compile_time_eval
=
1
self
.
compile_time_expr
=
0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment