Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addition, subtraction, multiplication and division do not work. #41

Open
TheSecondComing123 opened this issue Oct 11, 2022 · 0 comments

Comments

@TheSecondComing123
Copy link
Owner

>>> +1 1
Traceback (most recent call last):
  File "main.py", line 47, in <module>
    cli()
  File "main.py", line 31, in cli
    shell()
  File "main.py", line 43, in shell
    print(main(code))
  File "main.py", line 16, in main
    output = run(code, ctx=ctx)
  File "interpreter.py", line 55, in run
    return Interprete().main(parse(unpack(structure(tokenize(text)))), ctx)
  File "interpreter.py", line 19, in main
    main_output = self.interprete(tokens, ctx)
  File "interpreter.py", line 47, in interprete
    output = func(*list(args))
  File "functions.py", line 39, in Add
    if typecheck(args=[a, b], types=[Rational, Rational]):
  File "helper.py", line 43, in typecheck
    raise TypeError(f"Did you mean: [{args}]?") from None
TypeError: Did you mean: [[1, 1]]?

The error can be in the typecheck function, the functions in functions.py, Rational limitations, line 47 of interperator.py, and line 23 of parse.py.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant