git @ Cat's Eye Technologies Tamsin / 23777e3
Implement proper-oriented-quotes-sugar in parser. Chris Pressey 11 years ago
1 changed file(s) with 13 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
149149 return lhs
150150
151151 def expr5(self):
152 OQ = u'“'.encode('UTF-8')
153 CQ = u'”'.encode('UTF-8')
154
152155 if self.consume('('):
153156 e = self.expr0()
154157 self.expect(')')
166169 elif self.peek()[0] == '"':
167170 s = self.consume_any()[1:-1]
168171 return Call(Prodref('$', 'expect'), [AtomNode(s)])
172 elif len(self.peek()) >= len(OQ) and self.peek()[0:len(OQ)] == OQ:
173 s = self.consume_any()[len(OQ):-len(CQ)]
174 node = None
175 for c in s:
176 expect = Call(Prodref('$', 'expect'), [AtomNode(c)])
177 if node is None:
178 node = expect
179 else:
180 node = And(node, expect)
181 return node
169182 elif self.consume(u'«') or self.consume('<<'):
170183 t = self.texpr()
171184 if self.consume(u'»') or self.consume('>>'):