Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
francois
erp5
Commits
60f94952
Commit
60f94952
authored
11 years ago
by
Vincent Pelletier
Committed by
Julien Muchembled
11 years ago
Browse files
Options
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
:
...
...
This diff is collapsed.
Click to expand it.
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
...
...
This diff is collapsed.
Click to expand it.
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
)
...
...
This diff is collapsed.
Click to expand it.
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