160 """Eats comments and whitespace.""" |
160 """Eats comments and whitespace.""" |
161 input = self.source |
161 input = self.source |
162 startLine = self.line |
162 startLine = self.line |
163 |
163 |
164 # Whether this is the first called as happen on start parsing a file (eat leading comments/white space) |
164 # Whether this is the first called as happen on start parsing a file (eat leading comments/white space) |
165 startOfFile = self.cursor is 0 |
165 startOfFile = self.cursor == 0 |
166 |
166 |
167 indent = "" |
167 indent = "" |
168 |
168 |
169 while (True): |
169 while (True): |
170 if len(input) > self.cursor: |
170 if len(input) > self.cursor: |
252 |
252 |
253 text += ch |
253 text += ch |
254 |
254 |
255 try: |
255 try: |
256 self.comments.append(Comment.Comment(text, mode, self.line-1, "", self.fileId)) |
256 self.comments.append(Comment.Comment(text, mode, self.line-1, "", self.fileId)) |
257 except Comment.CommentException: |
257 except Comment.CommentException as commentError: |
258 Console.error("Ignoring comment in %s: %s", self.fileId, commentError) |
258 Console.error("Ignoring comment in %s: %s", self.fileId, commentError) |
259 |
259 |
260 # check for whitespace, also for special cases like 0xA0 |
260 # check for whitespace, also for special cases like 0xA0 |
261 elif ch in "\xA0 \t": |
261 elif ch in "\xA0 \t": |
262 indent += ch |
262 indent += ch |