Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(329)

Side by Side Diff: third_party/cython/src/Cython/Plex/Errors.py

Issue 385073004: Adding cython v0.20.2 in third-party. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reference cython dev list thread. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 #=======================================================================
2 #
3 # Python Lexical Analyser
4 #
5 # Exception classes
6 #
7 #=======================================================================
8
9 class PlexError(Exception):
10 message = ""
11
12 class PlexTypeError(PlexError, TypeError):
13 pass
14
15 class PlexValueError(PlexError, ValueError):
16 pass
17
18 class InvalidRegex(PlexError):
19 pass
20
21 class InvalidToken(PlexError):
22
23 def __init__(self, token_number, message):
24 PlexError.__init__(self, "Token number %d: %s" % (token_number, message))
25
26 class InvalidScanner(PlexError):
27 pass
28
29 class AmbiguousAction(PlexError):
30 message = "Two tokens with different actions can match the same string"
31
32 def __init__(self):
33 pass
34
35 class UnrecognizedInput(PlexError):
36 scanner = None
37 position = None
38 state_name = None
39
40 def __init__(self, scanner, state_name):
41 self.scanner = scanner
42 self.position = scanner.get_position()
43 self.state_name = state_name
44
45 def __str__(self):
46 return ("'%s', line %d, char %d: Token not recognised in state %s"
47 % (self.position + (repr(self.state_name),)))
48
49
50
OLDNEW
« no previous file with comments | « third_party/cython/src/Cython/Plex/DFA.py ('k') | third_party/cython/src/Cython/Plex/Lexicons.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698