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
9ce66875
Commit
9ce66875
authored
Apr 22, 2011
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove trailing whitespace
parent
44892185
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
211 additions
and
211 deletions
+211
-211
Cython/Compiler/Main.py
Cython/Compiler/Main.py
+1
-1
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+5
-5
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+9
-9
Cython/Compiler/ParseTreeTransforms.py
Cython/Compiler/ParseTreeTransforms.py
+2
-2
Cython/Compiler/Parsing.py
Cython/Compiler/Parsing.py
+2
-2
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+180
-180
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+12
-12
No files found.
Cython/Compiler/Main.py
View file @
9ce66875
...
...
@@ -613,7 +613,7 @@ def run_pipeline(source, options, full_module_name = None):
if
os
.
path
.
exists
(
html_filename
):
line
=
codecs
.
open
(
html_filename
,
"r"
,
encoding
=
"UTF-8"
).
readline
()
if
line
.
startswith
(
u'<!-- Generated by Cython'
):
options
.
annotate
=
True
options
.
annotate
=
True
# Get pipeline
if
source_ext
.
lower
()
==
'.py'
:
...
...
Cython/Compiler/ModuleNode.py
View file @
9ce66875
...
...
@@ -73,7 +73,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
self
.
generate_c_code
(
env
,
options
,
result
)
self
.
generate_h_code
(
env
,
options
,
result
)
self
.
generate_api_code
(
env
,
result
)
def
has_imported_c_functions
(
self
):
for
module
in
self
.
referenced_modules
:
for
entry
in
module
.
cfunc_entries
:
...
...
@@ -166,7 +166,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
def
api_name
(
self
,
env
):
return
env
.
qualified_name
.
replace
(
"."
,
"__"
)
def
generate_api_code
(
self
,
env
,
result
):
def
api_entries
(
entries
,
pxd
=
0
):
return
[
entry
for
entry
in
entries
...
...
@@ -249,7 +249,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
def
generate_cclass_header_code
(
self
,
type
,
h_code
):
h_code
.
putln
(
"%s %s %s;"
%
(
Naming
.
extern_c_macro
,
Naming
.
extern_c_macro
,
PyrexTypes
.
public_decl
(
"PyTypeObject"
,
"DL_IMPORT"
),
type
.
typeobj_cname
))
...
...
@@ -1002,7 +1002,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
storage_class
=
"static "
dll_linkage
=
None
type
=
entry
.
type
if
not
definition
and
entry
.
defined_in_pxd
:
type
=
CPtrType
(
type
)
header
=
type
.
declaration_code
(
entry
.
cname
,
...
...
@@ -1775,7 +1775,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code
.
putln
(
"#endif"
)
code
.
putln
(
"{"
)
tempdecl_code
=
code
.
insertion_point
()
code
.
put_declare_refcount_context
()
code
.
putln
(
"#if CYTHON_REFNANNY"
)
code
.
putln
(
"__Pyx_RefNanny = __Pyx_RefNannyImportAPI(
\
"
refnanny
\
"
);"
)
...
...
Cython/Compiler/Nodes.py
View file @
9ce66875
...
...
@@ -548,7 +548,7 @@ class CFuncDeclaratorNode(CDeclaratorNode):
other_type
=
type_node
.
analyse_as_type
(
env
)
if
other_type
is
None
:
error
(
type_node
.
pos
,
"Not a type"
)
elif
(
type
is
not
PyrexTypes
.
py_object_type
elif
(
type
is
not
PyrexTypes
.
py_object_type
and
not
type
.
same_as
(
other_type
)):
error
(
self
.
base
.
pos
,
"Signature does not agree with previous declaration"
)
error
(
type_node
.
pos
,
"Previous declaration here"
)
...
...
@@ -1099,7 +1099,7 @@ class CEnumDefNode(StatNode):
# api boolean
# in_pxd boolean
# entry Entry
child_attrs
=
[
"items"
]
def
analyse_declarations
(
self
,
env
):
...
...
@@ -1146,7 +1146,7 @@ class CEnumDefItemNode(StatNode):
if
not
self
.
value
.
type
.
is_int
:
self
.
value
=
self
.
value
.
coerce_to
(
PyrexTypes
.
c_int_type
,
env
)
self
.
value
.
analyse_const_expression
(
env
)
entry
=
env
.
declare_const
(
self
.
name
,
enum_entry
.
type
,
entry
=
env
.
declare_const
(
self
.
name
,
enum_entry
.
type
,
self
.
value
,
self
.
pos
,
cname
=
self
.
cname
,
visibility
=
enum_entry
.
visibility
,
api
=
enum_entry
.
api
)
enum_entry
.
enum_values
.
append
(
entry
)
...
...
@@ -1170,7 +1170,7 @@ class CTypeDefNode(StatNode):
cname
=
cname
,
visibility
=
self
.
visibility
,
api
=
self
.
api
)
if
self
.
in_pxd
and
not
env
.
in_cinclude
:
entry
.
defined_in_pxd
=
1
def
analyse_expressions
(
self
,
env
):
pass
def
generate_execution_code
(
self
,
code
):
...
...
@@ -1221,7 +1221,7 @@ class FuncDefNode(StatNode, BlockNode):
other_type
=
type_node
.
analyse_as_type
(
env
)
if
other_type
is
None
:
error
(
type_node
.
pos
,
"Not a type"
)
elif
(
type
is
not
PyrexTypes
.
py_object_type
elif
(
type
is
not
PyrexTypes
.
py_object_type
and
not
type
.
same_as
(
other_type
)):
error
(
arg
.
base_type
.
pos
,
"Signature does not agree with previous declaration"
)
error
(
type_node
.
pos
,
"Previous declaration here"
)
...
...
@@ -1815,7 +1815,7 @@ class CFuncDefNode(FuncDefNode):
self
.
modifiers
[
self
.
modifiers
.
index
(
'inline'
)]
=
'cython_inline'
if
self
.
modifiers
:
modifiers
=
"%s "
%
' '
.
join
(
self
.
modifiers
).
upper
()
header
=
self
.
return_type
.
declaration_code
(
entity
,
dll_linkage
=
dll_linkage
)
#print (storage_class, modifiers, header)
code
.
putln
(
"%s%s%s {"
%
(
storage_class
,
modifiers
,
header
))
...
...
@@ -3446,7 +3446,7 @@ class CClassDefNode(ClassDefNode):
visibility
=
self
.
visibility
,
typedef_flag
=
self
.
typedef_flag
,
api
=
self
.
api
,
buffer_defaults
=
buffer_defaults
,
buffer_defaults
=
buffer_defaults
,
shadow
=
self
.
shadow
)
if
self
.
shadow
:
home_scope
.
lookup
(
self
.
class_name
).
as_variable
=
self
.
entry
...
...
@@ -4172,8 +4172,8 @@ class RaiseStatNode(StatNode):
if
self
.
exc_type
and
not
self
.
exc_value
and
not
self
.
exc_tb
:
exc
=
self
.
exc_type
import
ExprNodes
if
(
isinstance
(
exc
,
ExprNodes
.
SimpleCallNode
)
and
not
(
exc
.
args
or
(
exc
.
arg_tuple
is
not
None
and
if
(
isinstance
(
exc
,
ExprNodes
.
SimpleCallNode
)
and
not
(
exc
.
args
or
(
exc
.
arg_tuple
is
not
None
and
exc
.
arg_tuple
.
args
))):
exc
=
exc
.
function
# extract the exception type
if
exc
.
is_name
and
exc
.
entry
.
is_builtin
:
...
...
Cython/Compiler/ParseTreeTransforms.py
View file @
9ce66875
...
...
@@ -1211,7 +1211,7 @@ if VALUE is not None:
arg
=
copy
.
deepcopy
(
arg_template
)
arg
.
declarator
.
name
=
entry
.
name
init_method
.
args
.
append
(
arg
)
# setters/getters
for
entry
,
attr
in
zip
(
var_entries
,
attributes
):
# TODO: branch on visibility
...
...
@@ -1224,7 +1224,7 @@ if VALUE is not None:
},
pos
=
entry
.
pos
).
stats
[
0
]
property
.
name
=
entry
.
name
wrapper_class
.
body
.
stats
.
append
(
property
)
wrapper_class
.
analyse_declarations
(
self
.
env_stack
[
-
1
])
return
self
.
visit_CClassDefNode
(
wrapper_class
)
...
...
Cython/Compiler/Parsing.py
View file @
9ce66875
...
...
@@ -2525,7 +2525,7 @@ def p_c_struct_or_union_definition(s, pos, ctx):
s
.
expect_dedent
()
else
:
s
.
expect_newline
(
"Syntax error in struct or union definition"
)
return
Nodes
.
CStructOrUnionDefNode
(
pos
,
return
Nodes
.
CStructOrUnionDefNode
(
pos
,
name
=
name
,
cname
=
cname
,
kind
=
kind
,
attributes
=
attributes
,
typedef_flag
=
ctx
.
typedef_flag
,
visibility
=
ctx
.
visibility
,
api
=
ctx
.
api
,
in_pxd
=
ctx
.
level
==
'module_pxd'
,
packed
=
packed
)
...
...
@@ -2613,7 +2613,7 @@ def p_ctypedef_statement(s, ctx):
s
.
expect_newline
(
"Syntax error in ctypedef statement"
)
return
Nodes
.
CTypeDefNode
(
pos
,
base_type
=
base_type
,
declarator
=
declarator
,
declarator
=
declarator
,
visibility
=
visibility
,
api
=
api
,
in_pxd
=
ctx
.
level
==
'module_pxd'
)
...
...
Cython/Compiler/PyrexTypes.py
View file @
9ce66875
This diff is collapsed.
Click to expand it.
Cython/Compiler/Symtab.py
View file @
9ce66875
...
...
@@ -401,13 +401,13 @@ class Scope(object):
except ValueError, e:
error(pos, e.args[0])
type = PyrexTypes.error_type
entry = self.declare_type(name, type, pos, cname,
entry = self.declare_type(name, type, pos, cname,
visibility = visibility, api = api)
type.qualified_name = entry.qualified_name
return entry
def declare_struct_or_union(self, name, kind, scope,
typedef_flag, pos, cname = None,
def declare_struct_or_union(self, name, kind, scope,
typedef_flag, pos, cname = None,
visibility = 'private', api = 0,
packed = False):
# Add an entry for a struct or union definition.
...
...
@@ -488,7 +488,7 @@ class Scope(object):
if entry.visibility != visibility:
error(pos, "'%s'
previously
declared
as
'%s'" % (
entry.name, entry.visibility))
def declare_enum(self, name, pos, cname, typedef_flag,
visibility = 'private', api = 0):
if name:
...
...
@@ -504,7 +504,7 @@ class Scope(object):
visibility = visibility, api = api)
entry.enum_values = []
self.sue_entries.append(entry)
return entry
return entry
def declare_var(self, name, type, pos,
cname = None, visibility = 'private', api = 0, is_cdef = 0):
...
...
@@ -1059,7 +1059,7 @@ class ModuleScope(Scope):
buffer_defaults = None, shadow = 0):
# If this is a non-extern typedef class, expose the typedef, but use
# the non-typedef struct internally to avoid needing forward
# declarations for anonymous structs.
# declarations for anonymous structs.
if typedef_flag and visibility != 'extern':
if not (visibility == 'public' or api):
warning(pos, "
ctypedef
only
valid
for
'extern'
,
'public'
,
and
'api'", 2)
...
...
@@ -1462,7 +1462,7 @@ class StructOrUnionScope(Scope):
def
declare_cfunction
(
self
,
name
,
type
,
pos
,
cname
=
None
,
visibility
=
'private'
,
defining
=
0
,
api
=
0
,
in_pxd
=
0
,
modifiers
=
()):
# currently no utility code ...
return
self
.
declare_var
(
name
,
type
,
pos
,
return
self
.
declare_var
(
name
,
type
,
pos
,
cname
=
cname
,
visibility
=
visibility
)
class
ClassScope
(
Scope
):
...
...
@@ -1627,7 +1627,7 @@ class CClassScope(ClassScope):
if
name
==
"__new__"
:
error
(
pos
,
"__new__ method of extension type will change semantics "
"in a future version of Pyrex and Cython. Use __cinit__ instead."
)
entry
=
self
.
declare_var
(
name
,
py_object_type
,
pos
,
entry
=
self
.
declare_var
(
name
,
py_object_type
,
pos
,
visibility
=
'extern'
)
special_sig
=
get_special_method_signature
(
name
)
if
special_sig
:
...
...
@@ -1753,7 +1753,7 @@ class CppClassScope(Scope):
self
.
inherited_var_entries
=
[]
def
declare_var
(
self
,
name
,
type
,
pos
,
cname
=
None
,
visibility
=
'extern'
,
api
=
0
,
cname
=
None
,
visibility
=
'extern'
,
api
=
0
,
is_cdef
=
0
,
allow_pyobject
=
0
):
# Add an entry for an attribute.
if
not
cname
:
...
...
@@ -1795,7 +1795,7 @@ class CppClassScope(Scope):
error
(
pos
,
"no matching function for call to %s::%s()"
%
(
self
.
default_constructor
,
self
.
default_constructor
))
def
declare_cfunction
(
self
,
name
,
type
,
pos
,
cname
=
None
,
def
declare_cfunction
(
self
,
name
,
type
,
pos
,
cname
=
None
,
visibility
=
'extern'
,
api
=
0
,
defining
=
0
,
in_pxd
=
0
,
modifiers
=
(),
utility_code
=
None
):
if
name
==
self
.
name
.
split
(
'::'
)[
-
1
]
and
cname
is
None
:
...
...
@@ -1803,7 +1803,7 @@ class CppClassScope(Scope):
name
=
'<init>'
type
.
return_type
=
self
.
lookup
(
self
.
name
).
type
prev_entry
=
self
.
lookup_here
(
name
)
entry
=
self
.
declare_var
(
name
,
type
,
pos
,
entry
=
self
.
declare_var
(
name
,
type
,
pos
,
cname
=
cname
,
visibility
=
visibility
)
if
prev_entry
:
entry
.
overloaded_alternatives
=
prev_entry
.
all_alternatives
()
...
...
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