git @ Cat's Eye Technologies Falderal / cafefa2
It errors now. Chris Pressey 6 years ago
1 changed file(s) with 20 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
196196 """
197197
198198 PREFIXES = [
199 u'==> ',
200 u'??> ',
199201 u'| ',
200202 u'+ ',
201203 u'? ',
293295 line_num=self.line_num, filename=self.filename, lines=lines
294296 )
295297
298 def reconstruct(pattern, except_prefixes):
299 new_pattern = []
300 lines = []
301 for (candidate_prefix, candidate_lines) in pattern:
302 if candidate_prefix in except_prefixes:
303 new_pattern.append((candidate_prefix, candidate_lines))
304 else:
305 lines.extend([candidate_prefix + line for line in candidate_lines])
306 return [(u'', lines)] + new_pattern
307
296308 if '' in pattern_prefixes:
297309 # There is plain, non-prefixed text embedded somewhere in this Block.
298 # TODO: interpret this according to the new, not-yet-written rules.
299 # For now, assume it is Just Indented Text And That Is OK.
300 return None
310 # We interpret this according to the new, not-yet-written rules.
311 if pattern_prefixes[-1] in [[u'==> ', u'??> ']]:
312 pattern = reconstruct(pattern, [u'==> ', u'??> '])
313 pattern_prefixes = [p[0] for p in pattern]
314 else:
315 # TODO:issue a warning unless cavalier
316 # For now, assume it is Just Indented Text And That Is OK.
317 return None
301318
302319 if pattern_prefixes in [[u'= '], [u'? ']]:
303320 raise FalderalSyntaxError(