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
Boxiang Sun
cython
Commits
2721708d
Commit
2721708d
authored
Nov 11, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
another minor scanner speed-up
parent
654a6962
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
Cython/Plex/Scanners.py
Cython/Plex/Scanners.py
+9
-6
No files found.
Cython/Plex/Scanners.py
View file @
2721708d
...
@@ -163,7 +163,8 @@ class Scanner(object):
...
@@ -163,7 +163,8 @@ class Scanner(object):
buffer
=
self
.
buffer
buffer
=
self
.
buffer
buf_start_pos
=
self
.
buf_start_pos
buf_start_pos
=
self
.
buf_start_pos
buf_len
=
len
(
buffer
)
buf_len
=
len
(
buffer
)
backup_state
=
None
b_action
,
b_cur_pos
,
b_cur_line
,
b_cur_line_start
,
b_cur_char
,
b_input_state
,
b_next_pos
=
\
None
,
0
,
0
,
0
,
u''
,
0
,
0
trace
=
self
.
trace
trace
=
self
.
trace
while
1
:
while
1
:
if
trace
:
#TRACE#
if
trace
:
#TRACE#
...
@@ -173,8 +174,8 @@ class Scanner(object):
...
@@ -173,8 +174,8 @@ class Scanner(object):
#action = state.action #@slow
#action = state.action #@slow
action
=
state
[
'action'
]
#@fast
action
=
state
[
'action'
]
#@fast
if
action
is
not
None
:
if
action
is
not
None
:
b
ackup_state
=
(
b
_action
,
b_cur_pos
,
b_cur_line
,
b_cur_line_start
,
b_cur_char
,
b_input_state
,
b_next_pos
=
\
action
,
cur_pos
,
cur_line
,
cur_line_start
,
cur_char
,
input_state
,
next_pos
)
action
,
cur_pos
,
cur_line
,
cur_line_start
,
cur_char
,
input_state
,
next_pos
# End inlined self.save_for_backup()
# End inlined self.save_for_backup()
c
=
cur_char
c
=
cur_char
#new_state = state.new_state(c) #@slow
#new_state = state.new_state(c) #@slow
...
@@ -234,9 +235,11 @@ class Scanner(object):
...
@@ -234,9 +235,11 @@ class Scanner(object):
if
trace
:
#TRACE#
if
trace
:
#TRACE#
print
(
"blocked"
)
#TRACE#
print
(
"blocked"
)
#TRACE#
# Begin inlined: action = self.back_up()
# Begin inlined: action = self.back_up()
if
backup_state
is
not
None
:
if
b_action
is
not
None
:
(
action
,
cur_pos
,
cur_line
,
cur_line_start
,
(
action
,
cur_pos
,
cur_line
,
cur_line_start
,
cur_char
,
input_state
,
next_pos
)
=
backup_state
cur_char
,
input_state
,
next_pos
)
=
\
(
b_action
,
b_cur_pos
,
b_cur_line
,
b_cur_line_start
,
b_cur_char
,
b_input_state
,
b_next_pos
)
else
:
else
:
action
=
None
action
=
None
break
# while 1
break
# while 1
...
...
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