mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
tools/python: sxp parser: show empty string
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>
This commit is contained in:
1 parent
fb082c90a0
commit
f3fdbe7359
1 file changed
+2
@@ -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:
|
||||
|
||||