Skip to content
This repository has been archived by the owner on Jun 25, 2022. It is now read-only.

Fixes to run all example programs #10

Closed
wants to merge 10 commits into from

Conversation

thaliaarchi
Copy link

@thaliaarchi thaliaarchi commented May 1, 2021

This PR fixes several issues so that it can compile without error and run the Whitespace example programs. I made these changes while adding it to wspace-lang/ws-corpus, a collection of currently 124 interpreters, compilers, programs, and other tools for Whitespace.

  • Replace int with long long for stack/heap values and instruction arguments to give the largest range possible without using arbitrary-precision integers. This fixes programs that need larger integers, such as hanoi.ws.
  • Replace int with size_t for indices to resolve signed/unsigned comparison warnings.
  • Fix heap-related instructions (STORE, RETRIEVE, READC, and READN) and conditional branches (JUMPZERO and JUMPNEG).
  • Initialize label map before execution so that labels after the program counter can be jumped to.
  • Fix number argument parsing.
  • Only print tokens and instructions when --verbose/-v flag is given.
  • Interpret the file given by the filename, otherwise from stdin. Previously only hello_worldvanwiki.ws was interpreted.
  • Indent consistently with 4 spaces. While reviewing, it may be useful to compare changes without this commit.

Fixes #9, fixes #5.

@thaliaarchi
Copy link
Author

I’m closing this PR as it’s unreasonable of me to expect maintenance of an old, one-time project. Further contributions will be welcomed in my fork that I am maintaining in the wspace organization.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make the example work Fix the in-file commented questions
1 participant