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
0c0037ca
Commit
0c0037ca
authored
Sep 30, 2008
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
type cleanup
parent
0a77df1d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
26 deletions
+0
-26
Cython/Compiler/Parsing.py
Cython/Compiler/Parsing.py
+0
-17
Cython/Compiler/Scanning.py
Cython/Compiler/Scanning.py
+0
-9
No files found.
Cython/Compiler/Parsing.py
View file @
0c0037ca
...
...
@@ -1031,14 +1031,6 @@ def p_from_import_statement(s, first_statement = 0):
s
.
context
.
future_directives
.
add
(
directive
)
return
Nodes
.
PassStatNode
(
pos
)
elif
kind
==
'cimport'
:
for
(
name_pos
,
name
,
as_name
,
kind
)
in
imported_names
:
local_name
=
as_name
or
name
if
local_name
==
"*"
and
False
:
module
=
s
.
context
.
find_module
(
dotted_name
)
for
type
in
module
.
type_entries
:
s
.
add_type_name
(
type
.
name
)
else
:
s
.
add_type_name
(
local_name
)
return
Nodes
.
FromCImportStatNode
(
pos
,
module_name
=
dotted_name
,
imported_names
=
imported_names
)
...
...
@@ -1856,8 +1848,6 @@ def p_c_simple_declarator(s, ctx, empty, is_type, cmethod_flag,
rhs
=
None
if
s
.
sy
==
'IDENT'
:
name
=
EncodedString
(
s
.
systring
)
if
is_type
:
s
.
add_type_name
(
name
)
if
empty
:
error
(
s
.
position
(),
"Declarator should be empty"
)
s
.
next
()
...
...
@@ -2042,7 +2032,6 @@ def p_c_enum_definition(s, pos, ctx):
if
s
.
sy
==
'IDENT'
:
name
=
s
.
systring
s
.
next
()
s
.
add_type_name
(
name
)
cname
=
p_opt_cname
(
s
)
else
:
name
=
None
...
...
@@ -2092,7 +2081,6 @@ def p_c_struct_or_union_definition(s, pos, ctx):
s
.
next
()
name
=
p_ident
(
s
)
cname
=
p_opt_cname
(
s
)
s
.
add_type_name
(
name
)
attributes
=
None
if
s
.
sy
==
':'
:
s
.
next
()
...
...
@@ -2286,7 +2274,6 @@ def p_c_class_definition(s, pos, ctx):
as_name
=
p_ident
(
s
)
else
:
as_name
=
class_name
s
.
add_type_name
(
as_name
)
objstruct_name
=
None
typeobj_name
=
None
base_class_module
=
None
...
...
@@ -2387,8 +2374,6 @@ def p_doc_string(s):
return
None
def
p_code
(
s
,
level
=
None
):
s
.
add_type_name
(
"object"
)
s
.
add_type_name
(
"Py_buffer"
)
body
=
p_statement_list
(
s
,
Ctx
(
level
=
level
),
first_statement
=
1
)
if
s
.
sy
!=
'EOF'
:
s
.
error
(
"Syntax error in statement [%s,%s]"
%
(
...
...
@@ -2413,8 +2398,6 @@ def p_compiler_directive_comments(s):
return result
def p_module(s, pxd, full_module_name):
s.add_type_name("
object
")
s.add_type_name("
Py_buffer
")
pos = s.position()
doc = p_doc_string(s)
if pxd:
...
...
Cython/Compiler/Scanning.py
View file @
0c0037ca
...
...
@@ -282,7 +282,6 @@ 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
...
...
@@ -294,14 +293,12 @@ class PyrexScanner(Scanner):
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
=
scope
.
type_names
self
.
included_files
=
scope
.
included_files
self
.
compile_time_env
=
initial_compile_time_env
()
self
.
compile_time_eval
=
1
...
...
@@ -431,12 +428,6 @@ class PyrexScanner(Scanner):
# This method should be added to Plex
self
.
queue
.
insert
(
0
,
(
token
,
value
))
def
add_type_name
(
self
,
name
):
self
.
type_names
[
name
]
=
1
def
looking_at_type_name
(
self
):
return
self
.
sy
==
'IDENT'
and
self
.
systring
in
self
.
type_names
def
error
(
self
,
message
,
pos
=
None
,
fatal
=
True
):
if
pos
is
None
:
pos
=
self
.
position
()
...
...
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