michaeljabbour / michaeljabbour/altairbasic
Fix Interactive Mode RUN Command
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
# Fix Interactive Mode RUN Command
## Issue Description
When using the interactive mode, the RUN command does not execute the program from the beginning but appears to start from the last entered line. This makes the interpreter difficult to use in interactive mode.
## Steps to Reproduce
1. Start the interpreter in interactive mode: `./build/basic`
2. Enter the following program:
3. Type `RUN`
4. Observe that execution starts from line 40, not line 10
## Expected Behavior
- The RUN command should start execution from the first line of the program (lowest line number)
- All lines should be executed in order of their line numbers
## Technical Details
The problem may be in the interpreter's execute method when called from the RUN command. The interpreter should:
1. Find the lowest line number in the program
2. Start execution from that line
3. Continue until an END statement or the end of the program is reached
## Proposed Solution
1. Modify the RUN command handler to find the lowest line number in the program
2. Ensure the interpreter's state is reset before execution
3. Start execution from that line
## Related Components
- `src/main.cpp` - Command processing
- `src/core/interpreter.cpp` - Program execution
## Priority
High - This issue affects the primary way users interact with the interpreter.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read src/main.cpp for RUN command processing and src/core/interpreter.cpp for program execution and interpreter state. Reproduce the issue with ./build/basic, then verify that RUN begins at the lowest line number and executes through the program in line-number order until END or the program ends.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100