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
Kirill Smelkov
cython
Commits
ff067a8f
Commit
ff067a8f
authored
Nov 15, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reduced overhead in the scanner
parent
d472191c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
Cython/Plex/Scanners.py
Cython/Plex/Scanners.py
+5
-3
No files found.
Cython/Plex/Scanners.py
View file @
ff067a8f
...
...
@@ -8,11 +8,13 @@
#=======================================================================
import
cython
cython
.
declare
(
BOL
=
object
,
EOL
=
object
,
EOF
=
object
)
cython
.
declare
(
BOL
=
object
,
EOL
=
object
,
EOF
=
object
,
NOT_FOUND
=
object
)
import
Errors
from
Regexps
import
BOL
,
EOL
,
EOF
NOT_FOUND
=
object
()
class
Scanner
(
object
):
"""
A Scanner is used to read tokens from a stream of characters
...
...
@@ -179,8 +181,8 @@ class Scanner(object):
# End inlined self.save_for_backup()
c
=
cur_char
#new_state = state.new_state(c) #@slow
new_state
=
state
.
get
(
c
,
-
1
)
#@fast
if
new_state
==
-
1
:
#@fast
new_state
=
state
.
get
(
c
,
NOT_FOUND
)
#@fast
if
new_state
is
NOT_FOUND
:
#@fast
new_state
=
c
and
state
.
get
(
'else'
)
#@fast
if
new_state
:
if
trace
:
#TRACE#
...
...
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