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
ecd248ed
Commit
ecd248ed
authored
Nov 11, 2008
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more bootstrap tweaks
parent
99327e65
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
7 deletions
+15
-7
Cython/Compiler/Lexicon.py
Cython/Compiler/Lexicon.py
+2
-1
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+2
-1
Cython/Compiler/Scanning.py
Cython/Compiler/Scanning.py
+7
-3
Cython/Plex/Scanners.pxd
Cython/Plex/Scanners.pxd
+4
-2
No files found.
Cython/Compiler/Lexicon.py
View file @
ecd248ed
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
raw_prefixes
=
"rR"
raw_prefixes
=
"rR"
string_prefixes
=
"cCuUbB"
string_prefixes
=
"cCuUbB"
IDENT
=
'IDENT'
def
make_lexicon
():
def
make_lexicon
():
from
Cython.Plex
import
\
from
Cython.Plex
import
\
...
@@ -82,7 +83,7 @@ def make_lexicon():
...
@@ -82,7 +83,7 @@ def make_lexicon():
comment
=
Str
(
"#"
)
+
Rep
(
AnyBut
(
"
\
n
"
))
comment
=
Str
(
"#"
)
+
Rep
(
AnyBut
(
"
\
n
"
))
return
Lexicon
([
return
Lexicon
([
(
name
,
'IDENT'
),
(
name
,
IDENT
),
(
intliteral
,
'INT'
),
(
intliteral
,
'INT'
),
(
fltconst
,
'FLOAT'
),
(
fltconst
,
'FLOAT'
),
(
imagconst
,
'IMAG'
),
(
imagconst
,
'IMAG'
),
...
...
Cython/Compiler/Nodes.py
View file @
ecd248ed
...
@@ -756,7 +756,8 @@ class CVarDefNode(StatNode):
...
@@ -756,7 +756,8 @@ class CVarDefNode(StatNode):
entry
=
dest_scope
.
declare_cfunction
(
name
,
type
,
declarator
.
pos
,
entry
=
dest_scope
.
declare_cfunction
(
name
,
type
,
declarator
.
pos
,
cname
=
cname
,
visibility
=
self
.
visibility
,
in_pxd
=
self
.
in_pxd
,
cname
=
cname
,
visibility
=
self
.
visibility
,
in_pxd
=
self
.
in_pxd
,
api
=
self
.
api
)
api
=
self
.
api
)
entry
.
pxd_locals
=
self
.
pxd_locals
if
entry
is
not
None
:
entry
.
pxd_locals
=
self
.
pxd_locals
else
:
else
:
if
self
.
in_pxd
and
self
.
visibility
!=
'extern'
:
if
self
.
in_pxd
and
self
.
visibility
!=
'extern'
:
error
(
self
.
pos
,
error
(
self
.
pos
,
...
...
Cython/Compiler/Scanning.py
View file @
ecd248ed
...
@@ -11,11 +11,14 @@ import stat
...
@@ -11,11 +11,14 @@ import stat
import
sys
import
sys
from
time
import
time
from
time
import
time
import
cython
cython
.
declare
(
EncodedString
=
object
,
string_prefixes
=
object
,
raw_prefixes
=
object
,
IDENT
=
object
)
from
Cython
import
Plex
,
Utils
from
Cython
import
Plex
,
Utils
from
Cython.Plex.Scanners
import
Scanner
from
Cython.Plex.Scanners
import
Scanner
from
Cython.Plex.Errors
import
UnrecognizedInput
from
Cython.Plex.Errors
import
UnrecognizedInput
from
Errors
import
CompileError
,
error
from
Errors
import
CompileError
,
error
from
Lexicon
import
string_prefixes
,
raw_prefixes
,
make_lexicon
from
Lexicon
import
string_prefixes
,
raw_prefixes
,
make_lexicon
,
IDENT
from
StringEncoding
import
EncodedString
from
StringEncoding
import
EncodedString
...
@@ -168,6 +171,7 @@ def build_resword_dict():
...
@@ -168,6 +171,7 @@ def build_resword_dict():
d
[
word
]
=
1
d
[
word
]
=
1
return
d
return
d
cython
.
declare
(
resword_dict
=
object
)
resword_dict
=
build_resword_dict
()
resword_dict
=
build_resword_dict
()
#------------------------------------------------------------------
#------------------------------------------------------------------
...
@@ -407,7 +411,7 @@ class PyrexScanner(Scanner):
...
@@ -407,7 +411,7 @@ class PyrexScanner(Scanner):
sy
,
systring
=
self
.
read
()
sy
,
systring
=
self
.
read
()
except
UnrecognizedInput
:
except
UnrecognizedInput
:
self
.
error
(
"Unrecognized character"
)
self
.
error
(
"Unrecognized character"
)
if
sy
==
'IDENT'
:
if
sy
==
IDENT
:
if
systring
in
resword_dict
:
if
systring
in
resword_dict
:
sy
=
systring
sy
=
systring
else
:
else
:
...
@@ -447,7 +451,7 @@ class PyrexScanner(Scanner):
...
@@ -447,7 +451,7 @@ class PyrexScanner(Scanner):
self
.
expected
(
what
,
message
)
self
.
expected
(
what
,
message
)
def
expect_keyword
(
self
,
what
,
message
=
None
):
def
expect_keyword
(
self
,
what
,
message
=
None
):
if
self
.
sy
==
'IDENT'
and
self
.
systring
==
what
:
if
self
.
sy
==
IDENT
and
self
.
systring
==
what
:
self
.
next
()
self
.
next
()
else
:
else
:
self
.
expected
(
what
,
message
)
self
.
expected
(
what
,
message
)
...
...
Cython/Plex/Scanners.pxd
View file @
ecd248ed
import
cython
import
cython
cdef
class
Scanner
:
cdef
class
Scanner
:
cdef
public
lexicon
cdef
public
lexicon
cdef
public
stream
cdef
public
stream
cdef
public
name
cdef
public
name
...
@@ -20,12 +21,13 @@ cdef class Scanner:
...
@@ -20,12 +21,13 @@ cdef class Scanner:
cdef
public
bint
trace
cdef
public
bint
trace
cdef
public
cur_char
cdef
public
cur_char
cdef
public
input_state
cdef
public
input_state
cdef
public
level
# int?
cdef
public
level
cpdef
next_char
(
self
):
cpdef
next_char
(
self
):
cdef
:
cdef
:
long
input_state
long
input_state
cpdef
read
(
self
)
cpdef
run_machine_inlined
(
self
):
cpdef
run_machine_inlined
(
self
):
cdef
:
cdef
:
...
...
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