/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to parser.py

  • Committer: Samuel Bronson
  • Date: 2009-07-18 23:09:23 UTC
  • mto: (0.64.183 trunk)
  • mto: This revision was merged to the branch mainline in revision 6631.
  • Revision ID: naesten@gmail.com-20090718230923-gusyiva3qejbb17i
Implement here-document style input data.

Fixes bug #400960.

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
 
89
89
    # note: delim may be any string but must not contain lf.
90
90
    # data_line may contain any data but must not be exactly
91
 
    # delim.
 
91
    # delim. The lf after the final data_line is included in
 
92
    # the data.
92
93
  delimited_data ::= 'data' sp '<<' delim lf
93
94
    (data_line lf)*
94
95
    delim lf;
234
235
 
235
236
        :return: the bytes read up to but excluding the terminator.
236
237
        """
237
 
        raise NotImplementedError(self.read_until)
 
238
        
 
239
        lines = []
 
240
        term = terminator + '\n'
 
241
        while True:
 
242
            line = self.input.readline()
 
243
            if line == term:
 
244
                break
 
245
            else:
 
246
                lines.append(line)
 
247
        return ''.join(lines)
238
248
 
239
249
 
240
250
# Regular expression used for parsing. (Note: The spec states that the name