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

1(2+3): The value Int(1) is generally not callable! - hint for user? #117

Open
phorward opened this issue Aug 7, 2023 · 1 comment
Open

Comments

@phorward
Copy link
Member

phorward commented Aug 7, 2023

The input 1(2+3) should not be parsed as a function call.

$ cargo run -- -d
Tokay 0.6.4
>>> 1(2+3)
main [start 1:1, end 1:7]
 call [start 1:1, end 1:7]
  value_integer [start 1:1, end 1:2] => 1
  callarg [start 1:3, end 1:6]
   op_binary_add [start 1:3, end 1:6]
    value_integer [start 1:3, end 1:4] => 2
    value_integer [start 1:5, end 1:6] => 3
thread 'main' panicked at 'not yet implemented: The value Int(1) is generally not callable!', src/compiler/iml/imlop.rs:135:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
@phorward phorward added bug Something isn't working syntax tokay labels Aug 7, 2023
@phorward phorward changed the title bug: The value Int(1) is generally not callable! bug: 1(2+3): The value Int(1) is generally not callable! Aug 7, 2023
@phorward
Copy link
Member Author

This is not considered as a bug anymore.

It is equal when calling in Python:

>>> 1(2+3)
<stdin>:1: SyntaxWarning: 'int' object is not callable; perhaps you missed a comma?
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'int' object is not callable
>>> 1,2
(1, 2)

A good solution would be to provide an adequate warning as shown above.

@phorward phorward removed the bug Something isn't working label Aug 15, 2023
@phorward phorward changed the title bug: 1(2+3): The value Int(1) is generally not callable! 1(2+3): The value Int(1) is generally not callable! - hint for user? Aug 15, 2023
@phorward phorward removed the tokay label Oct 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant