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

[FEATURE] Change implementation of input in parser #353

Open
frankhart2018 opened this issue Dec 6, 2020 · 2 comments
Open

[FEATURE] Change implementation of input in parser #353

frankhart2018 opened this issue Dec 6, 2020 · 2 comments
Assignees
Labels
easy Easy problem enhancement New feature or request

Comments

@frankhart2018
Copy link
Member

frankhart2018 commented Dec 6, 2020

Describe the solution you'd like
Currently input is considered part of expression function (which makes sense) but when it loses its identity when opcodes are created. For example:-

The simc line - var a = input("Enter a number: ", "i"), produces the opcode - OpCode('var_assign', 'a---Enter a number: ---i', 'int').

If we could add the input to either the type or the value then it would make more sense. It would also help in check_include function in compiler.py which includes stdio.h for inputs, it does so by checking if an opcode's value is split by --- and has a length of 3 or more then it will be an input statement, though this is true for the current implementation but might break in future versions so adding some sense of input to the opcode generated by the parser would help in this step too.

There are minor changes in the compiler loop too.

@frankhart2018 frankhart2018 added enhancement New feature or request easy Easy problem KWoC'20 These issues are being listed as part of KWoC'20 labels Dec 6, 2020
@sahmed007
Copy link

Hi, can I work on this feature?

@frankhart2018
Copy link
Member Author

Sure assigning this to you @sahmed007.

@frankhart2018 frankhart2018 removed the KWoC'20 These issues are being listed as part of KWoC'20 label Jan 6, 2021
@frankhart2018 frankhart2018 mentioned this issue Feb 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy Easy problem enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants