示例#1
0
文件: runtime.py 项目: silky/oil
def _ParseAndMakeTypes(schema_path, root):
    module = asdl.parse(schema_path)

    app_types = {}

    # Check for type errors
    if not asdl.check(module, app_types):
        raise AssertionError('ASDL file is invalid')
    py_meta.MakeTypes(module, root, app_types)
示例#2
0
文件: runtime.py 项目: optionalg/oil
def _ParseAndMakeTypes(f, root):
    module = asdl.parse(f)

    app_types = {'id': asdl.UserType(Id)}

    # Check for type errors
    if not asdl.check(module, app_types):
        raise AssertionError('ASDL file is invalid')
    py_meta.MakeTypes(module, root, app_types)
示例#3
0
文件: runtime.py 项目: xydinesh/oil
def _LoadSchema(f):
    module = asdl.parse(f)

    app_types = {'id': asdl.UserType(Id)}
    type_lookup = asdl.ResolveTypes(module, app_types)

    # Check for type errors
    if not asdl.check(module, app_types):
        raise AssertionError('ASDL file is invalid')
    return module, type_lookup
示例#4
0
def LoadSchema(f):
    app_types = {'id': asdl.UserType(Id)}

    asdl_module = asdl.parse(f)

    if not asdl.check(asdl_module, app_types):
        raise AssertionError('ASDL file is invalid')

    type_lookup = asdl.ResolveTypes(asdl_module, app_types)
    return asdl_module, type_lookup
示例#5
0
文件: ast_.py 项目: optionalg/oil
def _ParseAndMakeTypes(f, root):
  # TODO: A better syntax for this might be:
  #
  #     id = external
  #
  # in osh.asdl.  Then we can show an error if it's not provided.
  app_types = {'id': asdl.UserType(Id)}

  module = asdl.parse(f)

  # Check for type errors
  if not asdl.check(module, app_types):
    raise AssertionError('ASDL file is invalid')
  py_meta.MakeTypes(module, root, app_types)
示例#6
0
文件: py_ast.py 项目: waldyrious/oil
def _ParseAndMakeTypes(schema_path, root):
    module = asdl.parse(schema_path)

    app_types = {
        'identifier': asdl.UserType(Identifier),
        'bytes': asdl.UserType(Bytes),
        'object': asdl.UserType(PyObject),
        'constant': asdl.UserType(Constant),
        'singleton': asdl.UserType(Singleton),
    }

    # Check for type errors
    if not asdl.check(module, app_types):
        raise AssertionError('ASDL file is invalid')
    py_meta.MakeTypes(module, root, app_types)