summaryrefslogtreecommitdiffstats
path: root/third_party/python/fluent.syntax/fluent/syntax/__init__.py
blob: 0975b110b92dde0d9eed5a80242d6e0a6135fe65 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from .parser import FluentParser
from .serializer import FluentSerializer


def parse(source, **kwargs):
    """Create an ast.Resource from a Fluent Syntax source.
    """
    parser = FluentParser(**kwargs)
    return parser.parse(source)


def serialize(resource, **kwargs):
    """Serialize an ast.Resource to a unicode string.
    """
    serializer = FluentSerializer(**kwargs)
    return serializer.serialize(resource)