pyyaml / lib / yaml / parser.py

Diff from to

lib/yaml/parser.py

             token = self.scanner.peek()
             start_mark = end_mark = token.start_mark
             yield DocumentStartEvent(start_mark, end_mark,
-                    implicit=True)
+                    explicit=False)
             for event in self.parse_block_node():
                 yield event
             token = self.scanner.peek()
             start_mark = end_mark = token.start_mark
-            implicit = True
+            explicit = False
             while self.scanner.check(DocumentEndToken):
                 token = self.scanner.get()
                 end_mark = token.end_mark
-                implicit = True
+                explicit = True
             yield DocumentEndEvent(start_mark, end_mark,
-                    implicit=implicit)
+                    explicit=explicit)
 
         # Parse explicit documents.
         while not self.scanner.check(StreamEndToken):
             token = self.scanner.get()
             end_mark = token.end_mark
             yield DocumentStartEvent(start_mark, end_mark,
-                    implicit=False, version=version, tags=tags)
+                    explicit=True, version=version, tags=tags)
             if self.scanner.check(DirectiveToken,
                     DocumentStartToken, DocumentEndToken, StreamEndToken):
                 yield self.process_empty_scalar(token.end_mark)
                     yield event
             token = self.scanner.peek()
             start_mark = end_mark = token.start_mark
-            implicit=True
+            explicit = False
             while self.scanner.check(DocumentEndToken):
                 token = self.scanner.get()
                 end_mark = token.end_mark
-                implicit=False
+                explicit=True
             yield DocumentEndEvent(start_mark, end_mark,
-                    implicit=implicit)
+                    explicit=explicit)
 
         # Parse end of stream.
         token = self.scanner.get()
                     tag = self.tag_handles[handle]+suffix
                 else:
                     tag = suffix
-            if tag is None:
-                if not (self.scanner.check(ScalarToken) and
-                        self.scanner.peek().implicit):
-                    tag = u'!'
+            #if tag is None:
+            #    if not (self.scanner.check(ScalarToken) and
+            #            self.scanner.peek().implicit):
+            #        tag = u'!'
             if start_mark is None:
                 start_mark = end_mark = self.scanner.peek().start_mark
             event = None
                 if self.scanner.check(ScalarToken):
                     token = self.scanner.get()
                     end_mark = token.end_mark
+                    implicit = (tag is None and token.implicit)
                     event = ScalarEvent(anchor, tag, token.value,
                             start_mark, end_mark,
-                            implicit=token.implicit, style=token.style)
+                            implicit=implicit, style=token.style)
                 elif self.scanner.check(FlowSequenceStartToken):
                     end_mark = self.scanner.peek().end_mark
                     event = SequenceStartEvent(anchor, tag, start_mark, end_mark,
         while not self.scanner.check(FlowSequenceEndToken):
             if self.scanner.check(KeyToken):
                 token = self.scanner.get()
-                yield MappingStartEvent(None, u'!',
+                yield MappingStartEvent(None, None, # u'!',
                         token.start_mark, token.end_mark,
                         flow_style=True)
                 if not self.scanner.check(ValueToken,
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.