def compose_scalar_node(self, anchor):
    event = self.get_event()
    tag = event.tag
    if ((tag is None) or (tag == u'!')):
        tag = self.resolve(ScalarNode, event.value, event.implicit)
    node = ScalarNode(tag, event.value, event.start_mark, event.end_mark, style=event.style, comment=event.comment)
    if (anchor is not None):
        self.anchors[anchor] = node
    return node
def compose_scalar_node(self, anchor):
    event = self.get_event()
    tag = event.tag
    if ((tag is None) or (tag == u'!')):
        tag = self.resolve(ScalarNode, event.value, event.implicit)
    node = ScalarNode(tag, event.value, event.start_mark, event.end_mark, style=event.style, comment=event.comment)
    if (anchor is not None):
        self.anchors[anchor] = node
    return node