[ooo-build-commit] .: bin/parse-scp2.py
Kohei Yoshida
kohei at kemper.freedesktop.org
Tue Jul 13 18:40:55 PDT 2010
bin/parse-scp2.py | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
New commits:
commit 54b5e82992896d498a50eb248a3e779b44fe606e
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Tue Jul 13 21:40:41 2010 -0400
Parse ';' correctly.
* bin/parse-scp2.py:
diff --git a/bin/parse-scp2.py b/bin/parse-scp2.py
index 79fcd93..faa91fa 100755
--- a/bin/parse-scp2.py
+++ b/bin/parse-scp2.py
@@ -62,13 +62,15 @@ class Scp2Parser(object):
token = ''
while i < n:
c = self.content[i]
- if c in '\t\n;':
+ if c in '\t\n':
c = ' '
- if c == ' ':
+ if c in ' ;':
if len(token) > 0:
self.tokens.append(token)
token = ''
+ if c == ';':
+ self.tokens.append(c)
else:
token += c
i += 1
@@ -127,7 +129,11 @@ class Scp2Parser(object):
elif left:
attr_name = self.token()
else:
- attr_value = self.token()
+ # Parse all the way up to ';'
+ attr_value = ''
+ while self.token() != ';':
+ attr_value += self.token()
+ self.next()
attrs[attr_name] = attr_value
left = True
More information about the ooo-build-commit
mailing list