Add support for forward slashes in config setting

This commit is contained in:
Andrew Resch 2009-10-03 22:53:21 +00:00
parent cb36beded4
commit c3193f3c70
1 changed files with 15 additions and 0 deletions

View File

@ -60,6 +60,21 @@ def atom(next, token):
return tuple(out) return tuple(out)
elif token[0] is tokenize.STRING: elif token[0] is tokenize.STRING:
return token[1][1:-1].decode("string-escape") return token[1][1:-1].decode("string-escape")
elif token[1] == "/":
count = token[-1].count("/")
# Check for a trailing / since it messes things up
trail = False
if token[-1][-1] == "/":
count -= 1
trail = True
for i in xrange(count * 2 - 1):
token = next()
# Check for trailing / and remove it
path = token[-1].decode("string-escape")
if trail:
path = path[0:-1]
token = next()
return path
elif token[0] is tokenize.NUMBER: elif token[0] is tokenize.NUMBER:
try: try:
return int(token[1], 0) return int(token[1], 0)