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

Implement NAME statement #99

Open
ianatha opened this issue Mar 11, 2024 · 1 comment · May be fixed by #101
Open

Implement NAME statement #99

ianatha opened this issue Mar 11, 2024 · 1 comment · May be fixed by #101

Comments

@ianatha
Copy link
Owner

ianatha commented Mar 11, 2024

We should implement the QBasic "NAME" statement, which changes the name of a disk file or directory.

Its syntax is "NAME oldfilename AS newfilename".

The NAME statement is similar to the DOS RENAME command. NAME can move a file from one directory to another but cannot move a directory.

The arguments oldfilename and newfilename are string expressions each of which contains a file or directory name and an optional path. If the path in newfilename is different from the path in oldfilename, the NAME statement changes the pathname as well as renames the file as indicated.

Examples

NAME "ACCTS" AS "LEDGER"

In principle, resolving this is very similar to implementing the KILL statement in #96. Specifically, the skeleton for declaring a new QBasic statement is the same, but instead of deleting the file (like KILL does), we must rename it.

The relevant files to change are:

  • libbababasic/src/main/antlr/io/atha/libbababasic/grammar/BabaBASIC.g4
  • libbababasic/src/main/java/io/atha/libbababasic/file/BBFiles.kt
  • libbababasic/src/main/java/io/atha/libbababasic/parser/IR.kt
  • libbababasic/src/main/java/io/atha/libbababasic/parser/IRListener.kt
  • libbababasic/src/main/java/io/atha/libbababasic/runtime/BBRuntime.kt
  • libbababasic/src/main/java/io/atha/libbababasic/runtime/Functions.kt
Copy link
Contributor

sweep-ai bot commented Mar 16, 2024

Sweeping

25%


Actions (click)

  • ↻ Restart Sweep

❌ Unable to Complete PR

I'm sorry, but it looks like an error has occurred due to a planning failure. Feel free to add more details to the issue description so Sweep can better address it. Alternatively, reach out to Kevin or William for help at https://discord.gg/sweep.

For bonus GPT-4 tickets, please report this bug on Discord (tracking ID: e021fb92fe).


🎉 Latest improvements to Sweep:
  • New dashboard launched for real-time tracking of Sweep issues, covering all stages from search to coding.
  • Integration of OpenAI's latest Assistant API for more efficient and reliable code planning and editing, improving speed by 3x.
  • Use the GitHub issues extension for creating Sweep issues directly from your editor.

💡 To recreate the pull request edit the issue title or description.

@ianatha ianatha linked a pull request Mar 16, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant