src/basilisp/lang/compiler/parser.py
def _resolve_sym(
    ctx: ParserContext, form: sym.Symbol
) -> Union[MaybeClass, MaybeHostForm, VarRef]:
    """Resolve a Basilisp symbol as a Var or Python name."""
    # Support special class-name syntax to instantiate new classes
    #   (Classname. *args)
    #   (aliased.Classname. *args)
    #   (fully.qualified.Classname. *args)
    if form.ns is None and form.name.endswith("."):
        try:
            ns, name = form.name[:-1].rsplit(".", maxsplit=1)
            form = sym.symbol(name, ns=ns)
        except ValueError:
            form = sym.symbol(form.name[:-1])

    if form.ns is not None:
        return __resolve_namespaced_symbol(ctx, form)
    else:
        return __resolve_bare_symbol(ctx, form)
def _resolve_sym(
    ctx: ParserContext, form: sym.Symbol
) -> Union[MaybeClass, MaybeHostForm, VarRef]:
    """Resolve a Basilisp symbol as a Var or Python name."""
    # Support special class-name syntax to instantiate new classes
    #   (Classname. *args)
    #   (aliased.Classname. *args)
    #   (fully.qualified.Classname. *args)
    if form.ns is None and form.name.endswith("."):
        try:
            ns, name = form.name[:-1].rsplit(".", maxsplit=1)
            form = sym.symbol(name, ns=ns)
        except ValueError:
            form = sym.symbol(form.name[:-1])

    if form.ns is not None:
        return __resolve_namespaced_symbol(ctx, form)
    else:
        return __resolve_bare_symbol(ctx, form)
def _resolve_sym ( ctx : ParserContext , form : sym . Symbol ) -> Union [ MaybeClass , MaybeHostForm , VarRef ] : # Support special class-name syntax to instantiate new classes #   (Classname. *args) #   (aliased.Classname. *args) #   (fully.qualified.Classname. *args) if form . ns is None and form . name . endswith ( "." ) : try : ns , name = form . name [ : - 1 ] . rsplit ( "." , maxsplit = 1 ) form = sym . symbol ( name , ns = ns ) except ValueError : form = sym . symbol ( form . name [ : - 1 ] ) if form . ns is not None : return __resolve_namespaced_symbol ( ctx , form ) else : return __resolve_bare_symbol ( ctx , form )
Resolve a Basilisp symbol as a Var or Python name.
Resolve a Basilisp symbol as a Var or Python name .