Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5_rtl_support
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
Romain Courteaud
erp5_rtl_support
Commits
60f94952
Commit
60f94952
authored
Oct 17, 2013
by
Vincent Pelletier
Committed by
Julien Muchembled
Oct 18, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ZSQLCatalog: add support for NULL value in SearchText parsing
parent
cb73785f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
4 deletions
+13
-4
product/ZSQLCatalog/SearchText/AdvancedSearchTextParser.py
product/ZSQLCatalog/SearchText/AdvancedSearchTextParser.py
+3
-1
product/ZSQLCatalog/SearchText/__init__.py
product/ZSQLCatalog/SearchText/__init__.py
+2
-2
product/ZSQLCatalog/SearchText/lexer.py
product/ZSQLCatalog/SearchText/lexer.py
+8
-1
No files found.
product/ZSQLCatalog/SearchText/AdvancedSearchTextParser.py
View file @
60f94952
...
...
@@ -264,7 +264,9 @@ class AdvancedSearchTextParser(lexer):
def
p_value
(
self
,
p
):
'''value : OPERATOR string
| string'''
| OPERATOR NULL
| string
| NULL'''
if
len
(
p
)
==
2
:
p
[
0
]
=
ValueNode
(
p
[
1
])
else
:
...
...
product/ZSQLCatalog/SearchText/__init__.py
View file @
60f94952
from
SearchTextParser
import
parse
,
isAdvancedSearchText
def
dequote
(
value
):
assert
isinstance
(
value
,
basestring
),
value
if
len
(
value
)
>=
2
and
value
[
0
]
==
value
[
-
1
]
==
'"'
and
value
[
-
2
]
!=
'
\
\
'
:
if
isinstance
(
value
,
basestring
)
and
len
(
value
)
>=
2
and
\
value
[
0
]
==
value
[
-
1
]
==
'"'
and
value
[
-
2
]
!=
'
\
\
'
:
escaped
=
False
value_list
=
[]
append
=
value_list
.
append
...
...
product/ZSQLCatalog/SearchText/lexer.py
View file @
60f94952
...
...
@@ -82,7 +82,9 @@ class lexer(object):
'WORD'
,
'OPERATOR'
,
'LEFT_PARENTHESE'
,
'RIGHT_PARENTHESE'
)
'RIGHT_PARENTHESE'
,
'NULL'
,
)
t_ignore
=
' '
...
...
@@ -123,6 +125,11 @@ class lexer(object):
r'[^><= :
\
(
\
)"
][
^
:
\
(
\
)
"]*'
return t
def t_NULL(self, t):
r'NULL'
t.value = None
return t
def parse(self, *args, **kw):
kw['lexer'] = self
return self.parser.parse(*args, **kw)
...
...
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