Skip to content

[FEATURE] Change implementation of input in parser #353

Description

@frankhart2018

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

easyEasy problemenhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions