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:
Ian Jackson committed 2010-06-28 16:49:45 +01:00
1 parent fb082c90a0
commit f3fdbe7359
1 file changed
+2
+2
View File
@@ -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:
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.