Commit abdfb826 authored by Nicolas Delaby's avatar Nicolas Delaby

Fix unparsed DoubleQuote bug in regex, extend unit_test

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20809 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b92f5467
......@@ -58,7 +58,7 @@ class FullTextKey(SearchKey):
t_DOUBLEQUOTE = r'(\")'
def t_WORD(self, t):
r'[^\+\-<>\(\)\~\*\"\s]$|[^\+\-<>\(\)\~\*\s]+[^\*\s\)]'
r'[^\+\-<>\(\)\~\*\"\s]$|[^\+\-<>\(\)\~\*\"\s]+[^\*\"\s\)]'
#r'[^\+\-<>\(\)\~\*\"\s]\S*'
#r'[\x7F-\xFF\w\d][\x7F-\xFF\w\d]*'
# WORD may contain arbitrary letters and numbers without white space
......
......@@ -134,6 +134,7 @@ size/Child/34"""
self.compare(FullTextKey, '+John -Doe',
('PLUS', 'WORD', 'MINUS', 'WORD',))
self.compare(FullTextKey, '.', ('WORD',))
self.compare(FullTextKey, '"John Doe"', ('DOUBLEQUOTE', 'WORD', 'WORD', 'DOUBLEQUOTE'))
self.compare(FullTextKey, 'John*', ('WORD', 'ASTERISK'))
self.compare(FullTextKey, '+apple +(>turnover <strudel)',
('PLUS', 'WORD', 'PLUS', 'LEFTPARENTHES', 'GREATERTHAN', 'WORD',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment