Lines Matching refs:line

50 line to start the next macro.  Optionally, a macro can be ended with
58 The first line of the expansion is always a blank like just for readability.
165 def AppendLine(self, line):
168 self._body += line
169 self._needNewLine = not line.endswith('\n')
206 for line in input_lines:
207 if line.startswith('PDDM-'):
208 directive = line.split(' ', 1)[0]
210 name, args = self._ParseDefineLine(line)
212 raise PDDMError('Attempt to redefine macro: "%s"' % line)
219 ' "%s"' % line)
222 raise PDDMError('Hit a line with an unknown directive: "%s"' % line)
225 current_macro.AppendLine(line)
229 if line.strip() == '':
232 raise PDDMError('Hit a line that wasn\'t a directive and no open macro'
233 ' definition: "%s"' % line)
237 line = input_line[12:].strip()
238 match = _MACRO_RE.match(line)
239 # Must match full line
240 if match is None or match.group(0) != line:
386 def TryAppend(self, line, line_num):
387 """Try appending a line.
390 line: The line to append.
391 line_num: The number of the line.
394 A tuple of (SUCCESS, CAN_ADD_MORE). If SUCCESS if False, the line
413 def Append(self, line):
414 self._lines.append(line)
441 def TryAppend(self, line, line_num):
442 if line.startswith('//%PDDM'):
444 self.Append(line)
454 def TryAppend(self, line, line_num):
455 if line.startswith('//%PDDM'):
456 directive = line.split(' ', 1)[0]
458 self.Append(line)
463 raise PDDMError('Ran into directive ("%s", line %d) while in "%s".' %
480 for line in captured_lines:
481 result.append(line)
483 # Always add a blank line, seems to read better. (If need be, add an
486 macro = line[directive_len:].strip()
489 # Since expansions are line oriented, strip trailing whitespace
512 def TryAppend(self, line, line_num):
513 if not line.startswith('//%'):
515 if line.startswith('//%PDDM'):
516 directive = line.split(' ', 1)[0]
520 raise PDDMError('Ran into directive ("%s", line %d) while in "%s".' %
522 self.Append(line)
542 def TryAppend(self, line, line_num):
543 if not line.startswith('//%PDDM-IMPORT-DEFINES '):
546 self.Append(line)
553 raise PDDMError('Got an IMPORT-DEFINES without a resolver (line %d):'
558 raise PDDMError('Resolver failed to find "%s" (line %d):'
575 for line_num, line in enumerate(lines, 1):
577 cur_section = self._MakeSection(line, line_num)
578 was_added, accept_more = cur_section.TryAppend(line, line_num)
580 cur_section = self._MakeSection(line, line_num)
581 was_added, accept_more = cur_section.TryAppend(line, line_num)
589 def _MakeSection(self, line, line_num):
590 if not line.startswith('//%PDDM'):
593 directive = line.split(' ', 1)[0]
601 raise PDDMError('Unexpected line %d: "%s".' % (line_num, line))