Rev 9402 | Rev 9407 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 9402 | Rev 9403 | ||
---|---|---|---|
Line 190... | Line 190... | ||
190 | self.file = file |
190 | self.file = file |
191 | self.lines = open(file, "r", encoding="utf-8").readlines() |
191 | self.lines = open(file, "r", encoding="utf-8").readlines() |
192 | self.line_idx = 0 |
192 | self.line_idx = 0 |
193 | self.i = 0 |
193 | self.i = 0 |
Line -... | Line 194... | ||
- | 194 | ||
- | 195 | def currline(self): |
|
- | 196 | return self.lines[self.line_idx] |
|
194 | 197 | ||
195 | def curr(self): |
198 | def curr(self): |
196 | try: return self.lines[self.line_idx][self.i] |
199 | try: return self.lines[self.line_idx][self.i] |
Line 197... | Line 200... | ||
197 | except: return '' |
200 | except: return '' |
Line 296... | Line 299... | ||
296 | # Update status of the line according to the next character |
299 | # Update status of the line according to the next character |
297 | self.update_status() |
300 | self.update_status() |
298 | return c |
301 | return c |
Line 299... | Line 302... | ||
299 | 302 | ||
- | 303 | def nextline(self): |
|
300 | def nextline(self): |
304 | prev_line = self.currline() |
301 | super().nextline() |
305 | super().nextline() |
302 | # If the line we leave was not a comment-only line |
306 | # If the line we leave was not a comment-only line |
303 | # then forget the collected comment |
307 | # then forget the collected comment |
304 | # Otherwise the collected comment should be complemented by comment from next line in step() |
308 | # Otherwise the collected comment should be complemented by comment from next line in step() |
- | 309 | if self.status_has_code: |
|
- | 310 | # But we should preserve comment for the next line |
|
- | 311 | # If previous line set align (cause many functions re documented |
|
- | 312 | # right before align set, not before their labels) |
|
305 | if self.status_has_code: |
313 | if not prev_line.startswith("align "): |
306 | self.comment = '' |
314 | self.comment = '' |
307 | # Reset the line status (now it's the status of the new line) |
315 | # Reset the line status (now it's the status of the new line) |
308 | self.status_reset() |
316 | self.status_reset() |
309 | # Set new status for this line according to the first character in the line |
317 | # Set new status for this line according to the first character in the line |