OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # | 2 # |
3 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 3 # Copyright (c) 2012 The Native Client Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 # | 6 # |
7 | 7 |
8 """ | 8 """ |
9 A simple recursive-descent parser for the table file format. | 9 A simple recursive-descent parser for the table file format. |
10 | 10 |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 line = self.input.readline() | 307 line = self.input.readline() |
308 if line: | 308 if line: |
309 return re.sub(r'#.*', '', line).strip() | 309 return re.sub(r'#.*', '', line).strip() |
310 else: | 310 else: |
311 self._reached_eof = True | 311 self._reached_eof = True |
312 return '' | 312 return '' |
313 | 313 |
314 def _unexpected(self, context='Unexpected line in input'): | 314 def _unexpected(self, context='Unexpected line in input'): |
315 """"Reports that we didn't find the expected context. """ | 315 """"Reports that we didn't find the expected context. """ |
316 raise Exception('Line %d: %s' % (self._line_no, context)) | 316 raise Exception('Line %d: %s' % (self._line_no, context)) |
OLD | NEW |