mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-01 01:02:59 +02:00
...
This commit is contained in:
parent
3f9c5a8719
commit
13d0a7f353
1 changed files with 4 additions and 4 deletions
|
|
@ -145,10 +145,10 @@ def __init__(self):
|
|||
|
||||
# Had to translate named constants to numeric values
|
||||
lex_scanner = re.Scanner([
|
||||
(r'[()]', lambda x,t: (1, t)),
|
||||
(r'@.+?:[^")\s]+', lambda x,t: (2, unicode(t))),
|
||||
(r'[^"()\s]+', lambda x,t: (2, unicode(t))),
|
||||
(r'".*?((?<!\\)")', lambda x,t: (3, t[1:-1])),
|
||||
(r'[()]', lambda x,t: (Parser.OPCODE, t)),
|
||||
(r'@.+?:[^")\s]+', lambda x,t: (Parser.WORD, unicode(t))),
|
||||
(r'[^"()\s]+', lambda x,t: (Parser.WORD, unicode(t))),
|
||||
(r'".*?((?<!\\)")', lambda x,t: (Parser.QUOTED_WORD, t[1:-1])),
|
||||
(r'\s+', None)
|
||||
], flags=re.DOTALL)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue