projects
/
xen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fb082c9
)
tools/python: sxp parser: show empty string
author
Ian Jackson
<Ian.Jackson@eu.citrix.com>
Mon, 28 Jun 2010 15:49:45 +0000
(16:49 +0100)
committer
Ian Jackson
<Ian.Jackson@eu.citrix.com>
Mon, 28 Jun 2010 15:49:45 +0000
(16:49 +0100)
This patch makes the sxp parser show empty string.
Test case:
import sxp
sxp.show(sxp.from_string('(a "")'))
sxp.show(sxp.from_string("(a '')"))
Without this patch:
(a )(a )
With this patch:
(a '')(a '')
Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
tools/python/xen/xend/sxp.py
patch
|
blob
|
history
diff --git
a/tools/python/xen/xend/sxp.py
b/tools/python/xen/xend/sxp.py
index c31f8e4d21c1517a666db1f5a6df6350a72faea4..c87270f0706934de01a3339bfb28eaa7323ff812 100644
(file)
--- a/
tools/python/xen/xend/sxp.py
+++ b/
tools/python/xen/xend/sxp.py
@@
-365,6
+365,8
@@
class Parser:
def atomp(sxpr):
"""Check if an sxpr is an atom.
"""
+ if sxpr == '':
+ return 0
if sxpr.isalnum() or sxpr == '@':
return 1
for c in sxpr: