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
698b502d
Commit
698b502d
authored
Nov 16, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more cythonisation in the scanner/parser
parent
423e2c0d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
13 deletions
+35
-13
Cython/Compiler/Parsing.pxd
Cython/Compiler/Parsing.pxd
+2
-1
Cython/Compiler/Scanning.pxd
Cython/Compiler/Scanning.pxd
+28
-7
Cython/Plex/Scanners.pxd
Cython/Plex/Scanners.pxd
+5
-5
No files found.
Cython/Compiler/Parsing.pxd
View file @
698b502d
...
@@ -68,7 +68,7 @@ cdef p_comp_if(PyrexScanner s, body)
...
@@ -68,7 +68,7 @@ cdef p_comp_if(PyrexScanner s, body)
cdef
p_dict_or_set_maker
(
PyrexScanner
s
)
cdef
p_dict_or_set_maker
(
PyrexScanner
s
)
cdef
p_backquote_expr
(
PyrexScanner
s
)
cdef
p_backquote_expr
(
PyrexScanner
s
)
cpdef
p_simple_expr_list
(
PyrexScanner
s
,
expr
=*
)
cpdef
p_simple_expr_list
(
PyrexScanner
s
,
expr
=*
)
cdef
p_test_or_starred_expr_list
(
s
,
expr
=*
)
cdef
p_test_or_starred_expr_list
(
PyrexScanner
s
,
expr
=*
)
cdef
p_testlist
(
PyrexScanner
s
)
cdef
p_testlist
(
PyrexScanner
s
)
cdef
p_testlist_star_expr
(
PyrexScanner
s
)
cdef
p_testlist_star_expr
(
PyrexScanner
s
)
cdef
p_testlist_comp
(
PyrexScanner
s
)
cdef
p_testlist_comp
(
PyrexScanner
s
)
...
@@ -111,6 +111,7 @@ cdef p_try_statement(PyrexScanner s)
...
@@ -111,6 +111,7 @@ cdef p_try_statement(PyrexScanner s)
cdef
p_except_clause
(
PyrexScanner
s
)
cdef
p_except_clause
(
PyrexScanner
s
)
cdef
p_include_statement
(
PyrexScanner
s
,
ctx
)
cdef
p_include_statement
(
PyrexScanner
s
,
ctx
)
cdef
p_with_statement
(
PyrexScanner
s
)
cdef
p_with_statement
(
PyrexScanner
s
)
cdef
p_with_items
(
PyrexScanner
s
)
cpdef
p_simple_statement
(
PyrexScanner
s
,
bint
first_statement
=
*
)
cpdef
p_simple_statement
(
PyrexScanner
s
,
bint
first_statement
=
*
)
cpdef
p_simple_statement_list
(
PyrexScanner
s
,
ctx
,
bint
first_statement
=
*
)
cpdef
p_simple_statement_list
(
PyrexScanner
s
,
ctx
,
bint
first_statement
=
*
)
cdef
p_compile_time_expr
(
PyrexScanner
s
)
cdef
p_compile_time_expr
(
PyrexScanner
s
)
...
...
Cython/Compiler/Scanning.pxd
View file @
698b502d
...
@@ -2,14 +2,21 @@ import cython
...
@@ -2,14 +2,21 @@ import cython
from
Cython.Plex.Scanners
cimport
Scanner
from
Cython.Plex.Scanners
cimport
Scanner
cdef
class
Method
:
cdef
object
name
cdef
object
__name__
cdef
class
CompileTimeScope
:
cdef
class
CompileTimeScope
:
cdef
public
entries
cdef
public
dict
entries
cdef
public
outer
cdef
public
CompileTimeScope
outer
cdef
declare
(
self
,
name
,
value
)
cdef
lookup_here
(
self
,
name
)
cpdef
lookup
(
self
,
name
)
cdef
class
PyrexScanner
(
Scanner
):
cdef
class
PyrexScanner
(
Scanner
):
cdef
public
context
cdef
public
context
cdef
public
list
included_files
cdef
public
list
included_files
cdef
public
compile_time_env
cdef
public
CompileTimeScope
compile_time_env
cdef
public
bint
compile_time_eval
cdef
public
bint
compile_time_eval
cdef
public
bint
compile_time_expr
cdef
public
bint
compile_time_expr
cdef
public
bint
parse_comments
cdef
public
bint
parse_comments
...
@@ -23,9 +30,23 @@ cdef class PyrexScanner(Scanner):
...
@@ -23,9 +30,23 @@ cdef class PyrexScanner(Scanner):
cdef
public
systring
cdef
public
systring
cdef
long
current_level
(
self
)
cdef
long
current_level
(
self
)
cpdef
begin
(
self
,
state
)
#cpdef commentline(self, text)
cpdef
next
(
self
)
#cpdef open_bracket_action(self, text)
cpdef
bint
expect
(
self
,
what
,
message
=
*
)
except
-
2
#cpdef close_bracket_action(self, text)
#cpdef newline_action(self, text)
#cpdef begin_string_action(self, text)
#cpdef end_string_action(self, text)
#cpdef unclosed_string_action(self, text)
@
cython
.
locals
(
current_level
=
cython
.
long
,
new_level
=
cython
.
long
)
@
cython
.
locals
(
current_level
=
cython
.
long
,
new_level
=
cython
.
long
)
cpdef
indentation_action
(
self
,
text
)
cpdef
indentation_action
(
self
,
text
)
#cpdef eof_action(self, text)
cdef
next
(
self
)
cdef
peek
(
self
)
#cpdef put_back(self, sy, systring)
#cdef unread(self, token, value)
cdef
bint
expect
(
self
,
what
,
message
=
*
)
except
-
2
cdef
expect_keyword
(
self
,
what
,
message
=
*
)
cdef
expected
(
self
,
what
,
message
=
*
)
cdef
expect_indent
(
self
)
cdef
expect_dedent
(
self
)
cdef
expect_newline
(
self
,
message
=
*
)
Cython/Plex/Scanners.pxd
View file @
698b502d
...
@@ -25,10 +25,10 @@ cdef class Scanner:
...
@@ -25,10 +25,10 @@ cdef class Scanner:
cdef
public
level
cdef
public
level
@
cython
.
locals
(
input_state
=
long
)
@
cython
.
locals
(
input_state
=
long
)
c
p
def
next_char
(
self
)
cdef
next_char
(
self
)
c
p
def
tuple
read
(
self
)
cdef
tuple
read
(
self
)
cdef
tuple
scan_a_token
(
self
)
cdef
tuple
scan_a_token
(
self
)
c
p
def
tuple
position
(
self
)
cdef
tuple
position
(
self
)
@
cython
.
locals
(
cur_pos
=
long
,
cur_line
=
long
,
cur_line_start
=
long
,
@
cython
.
locals
(
cur_pos
=
long
,
cur_line
=
long
,
cur_line_start
=
long
,
input_state
=
long
,
next_pos
=
long
,
state
=
dict
,
input_state
=
long
,
next_pos
=
long
,
state
=
dict
,
...
@@ -36,5 +36,5 @@ cdef class Scanner:
...
@@ -36,5 +36,5 @@ cdef class Scanner:
trace
=
bint
,
discard
=
long
,
data
=
unicode
,
buffer
=
unicode
)
trace
=
bint
,
discard
=
long
,
data
=
unicode
,
buffer
=
unicode
)
cdef
run_machine_inlined
(
self
)
cdef
run_machine_inlined
(
self
)
c
p
def
begin
(
self
,
state
)
cdef
begin
(
self
,
state
)
c
p
def
produce
(
self
,
value
,
text
=
*
)
cdef
produce
(
self
,
value
,
text
=
*
)
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