예제 #1
0
    def __init__(self):
        self.packages: List[Package] = []

        self._generate_builtin_package('typing',
                                       TypeUtils.get_types_from_typing_lib())
        self._generate_builtin_package('math',
                                       Math.get_methods_from_math_lib())
        self._generate_builtin_package('boa3.builtin', Builtin.boa_builtins)
        self._generate_builtin_package('boa3.builtin.contract',
                                       Builtin.package_symbols('contract'))
        self._generate_builtin_package('boa3.builtin.interop',
                                       Interop.package_symbols)
        self._generate_builtin_package('boa3.builtin.nativecontract',
                                       NativeContract.package_symbols)
        self._generate_builtin_package('boa3.builtin.type',
                                       Builtin.package_symbols('type'))
예제 #2
0
    def _get_boa3_builtin_package(self,
                                  packages: List[str]) -> Dict[str, ISymbol]:
        if len(packages) > 0:
            if len(packages) == 1:
                return Builtin.package_symbols(packages[0])

            if packages[0] == 'interop':
                return self._get_interop_symbols(packages[1])

        return self._get_boa3_builtin_symbols()