Changeset 258 for pyyaml/trunk/lib/yaml/composer.py
- Timestamp:
- 08/21/07 16:25:34 (6 years ago)
- File:
-
- 1 edited
-
pyyaml/trunk/lib/yaml/composer.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
pyyaml/trunk/lib/yaml/composer.py
r233 r258 26 26 if not self.check_event(StreamEndEvent): 27 27 return self.compose_document() 28 29 def get_single_node(self): 30 # Drop the STREAM-START event. 31 self.get_event() 32 33 # Compose a document if the stream is not empty. 34 document = None 35 if not self.check_event(StreamEndEvent): 36 document = self.compose_document() 37 38 # Ensure that the stream contains no more documents. 39 if not self.check_event(StreamEndEvent): 40 event = self.get_event() 41 raise ComposerError("expected a single document in the stream", 42 document.start_mark, "but found another document", 43 event.start_mark) 44 45 # Drop the STREAM-END event. 46 self.get_event() 47 48 return document 28 49 29 50 def compose_document(self):
Note: See TracChangeset
for help on using the changeset viewer.
