From d030bf95a1cccb2d515476feeba7dd76c0443095 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Fri, 30 Aug 2013 11:27:56 +0200 Subject: [PATCH] Minor cleanup and fix --- parse.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/parse.py b/parse.py index dc90208..18ff5b4 100644 --- a/parse.py +++ b/parse.py @@ -136,11 +136,6 @@ while idx < rulebook_length: if new_line == True: if tab_count > current_level + 1: raise Exception("Incorrect indentation") - else: - try: - target_rule = current_rule[tab_count - 1] - except KeyError, e: - pass# FIXME: raise Exception("Incorrect indentation (bug?)") if rulebook[idx:idx+2] == "=>": # Skip over this, it's optional at the start of a line @@ -150,7 +145,8 @@ while idx < rulebook_length: new_line = False if char == "\r": - pass #ignore + idx += 1 + continue # Ignore, we don't want carriage returns elif char == "\n": # Process if buff.strip() == "":