An interpreter written in Python for the imperative, stack-based language called Whitespace. This is a fork of https://github.com/dwayne/whitespace-python.
To install, simply use pip (or pipenv):
$ pip install whitespace2Let program.ws be any Whitespace program. To execute it, type:
$ whitespace program.wsYou can find example Whitespace programs at tests/fixtures.
For example, here's the factorial program:
$ whitespace fact.ws
Enter a number: 40
40! = 815915283247897734345611269596115894272000000000Recommended tools:
Clone the repository and install the dependencies:
$ git clone git@github.com:rzuckerm/whitespace-python.git
$ cd whitespace-python
$ poetry env <python-version>
$ poetry installwhere <python-version> is the version of python that you have installed. This must be at least python 3.8. Example for python 3.10:
$ poetry env 3.10You're now all set to begin development.
The code is formatted using black.
Run the formatter:
$ make formatThe code is linted using black and pylint.
Run the linters:
$ make lintTests are written using pytest.
Run all tests.
$ make testRun a specific test module.
$ make test PYTEST_ARGS="-vvl -m test.<my-module>"Run a specific test case.
$ make test PYTEST_ARGS="-vvl -k test.test_parser.ParserTestCase.test_it_parses_push"To get a list of make targets, run this:
$ make helpThanks to Edwin Brady and Chris Morris for designing/developing this programming language; they are also developers of the Idris programming language.