diff -r b3dd6ceda9bc tools/python/xen/xend/sxp.py --- a/tools/python/xen/xend/sxp.py Tue Aug 08 15:43:54 2006 +0100 +++ b/tools/python/xen/xend/sxp.py Wed Aug 09 13:32:48 2006 +0800 @@ -281,26 +281,26 @@ class Parser: raise ParseError(self, "invalid octal escape: out of range " + self.state.buf) if len(self.state.buf) == 3: octaldone() - + def octaldone(): d = chr(self.state.val) self.state.parent.buf += d self.pop_state() - - if self.at_eof(): - raise ParseError(self, "unexpected EOF") - elif '0' <= c <= '7': - octaldigit(c) - elif len(self.buf): - octaldone() - self.input_char(c) + + if self.at_eof(): + raise ParseError(self, "unexpected EOF") + elif '0' <= c <= '7': + octaldigit(c) + elif len(self.buf): + octaldone() + self.input_char(c) def state_hex(self, c): def hexdone(): d = chr(self.state.val) self.state.parent.buf += d self.pop_state() - + def hexdigit(c, d): self.state.val *= 16 self.state.val += ord(c) - ord(d) @@ -309,18 +309,18 @@ class Parser: raise ParseError(self, "invalid hex escape: out of range " + self.state.buf) if len(self.state.buf) == 2: hexdone() - - if self.at_eof(): - raise ParseError(self, "unexpected EOF") - elif '0' <= c <= '9': - hexdigit(c, '0') - elif 'A' <= c <= 'F': - hexdigit(c, 'A') - elif 'a' <= c <= 'f': - hexdigit(c, 'a') - elif len(buf): - hexdone() - self.input_char(c) + + if self.at_eof(): + raise ParseError(self, "unexpected EOF") + elif '0' <= c <= '9': + hexdigit(c, '0') + elif 'A' <= c <= 'F': + hexdigit(c, 'A') + elif 'a' <= c <= 'f': + hexdigit(c, 'a') + elif len(buf): + hexdone() + self.input_char(c) def begin_atom(self, c): self.push_state(self.state_atom)