source: branches/pyyaml3000/lib/yaml/__init__.py @ 57

Revision 57, 838 bytes checked in by xi, 9 years ago (diff)

Fix a few bugs.

Line 
1
2from error import *
3from reader import *
4from scanner import *
5from parser import *
6from composer import *
7from resolver import *
8from constructor import *
9
10from tokens import *
11from events import *
12from nodes import *
13
14def parse(data, Reader=Reader, Scanner=Scanner, Parser=Parser):
15    reader = Reader(data)
16    scanner = Scanner(reader)
17    parser = Parser(scanner)
18    return parser
19
20def load(data, Reader=Reader, Scanner=Scanner, Parser=Parser,
21        Composer=Composer, Resolver=Resolver, Constructor=Constructor):
22    reader = Reader(data)
23    scanner = Scanner(reader)
24    parser = Parser(scanner)
25    composer = Composer(parser)
26    resolver = Resolver(composer)
27    constructor = Constructor(resolver)
28    return constructor
29
30def load_document(*args, **kwds):
31    for document in load(*args, **kwds):
32        return document
33
Note: See TracBrowser for help on using the repository browser.