This Lisp Parentheses Checker is a Node.js application designed to validate the parentheses in a given Lisp code string. It ensures that all parentheses are properly closed and nested, a common requirement for the correctness of Lisp code.
- Checks if the parentheses in a Lisp code string are correctly balanced.
- Can be used from the command line to validate files containing Lisp code.
- Includes unit tests to ensure the reliability of the checker.
- Node.js (recommended version 12 or higher)
- Clone the repository to your local machine:
git clone https://github.com/your-username/lisp-parentheses-checker.git
- Navigate to the project directory:
cd lisp-parentheses-checker
- Install the necessary dependencies:
npm install
To check valid Lisp code string, pipe it directly from the command line:
cat testExamples/validLispProgram.lisp | npm start
To check invalid Lisp code string, pipe it directly from the command line:
cat testExamples/invalidLispProgram.lisp | npm start
Piping, takes the example file and streams it into the javascript application through stdin
To run the unit tests to ensure the program works as expected:
npm test
This project is set up using Node.js and Jest for unit testing. The source code is located in the src
directory, and tests are located with each file (quick check to make sure you have covered all tests). Contributions to extend functionality or improve the code are welcome.
Feel free to fork the repository and submit pull requests. For major changes, please open an issue first to discuss what you would like to change.
Ensure to update tests as appropriate.