Example #1
0
def test_simple_case():
    def foo(a, b: int, c=1.2):
        return [a, b, c]

    assert argser.call(foo, '1 2') == ['1', 2, 1.2]
    assert argser.call(foo, '2 3 -c 4.4') == ['2', 3, 4.4]

    def foo(a, b: List[int]):
        return [a, b]

    assert argser.call(foo, '1 2 3') == ['1', [2, 3]]
Example #2
0
from urgent.cli import cc
from argser import call
call(cc)
Example #3
0
from urgent.repl1s import repl
from argser import call

call(repl)
Example #4
0
def main():
    from argser import call
    call(comp)
Example #5
0
from proud.pybackend import PyBackEnd
from argser import call
from colorama import Fore, Style
from traceback import format_exc
import os


def check_code(filename):
    end = PyBackEnd()
    # try:
    end.main(filename, filename + '.sij')


    # except Exception as e:
    #     print(e)
    #     pass

    tc = end.top
    # print('checked:', Fore.GREEN)
    # for k, v in tc.tenv.items():
    #     print(k.name, ':', tc.tc_state.infer(v))
    # print(Style.RESET_ALL)


if __name__ == '__main__':
    call(check_code)