pridoujs
v1.0.7
Published
The pridou interpreter.
Downloads
8
Maintainers
Readme
🚀 Getting started
📦 Prerequisites
⚙️ Installation
First clone the project
git clone https://github.com/Pridou/pridou.git cd pridouThen install the dependencies required to run the project
npm installAnd finally launch the cli with the command below !
npx pridou
🔧 Configuration (optional)
You can modify the
buildin.tsif you want to add native constants or functionsexport const NATIVE_CONSTANTS; export const NATIVE_FUNCTIONS; ...You can modify the
lexer.tsif you want to add new tokensexport const SKIPPED_TOKENS; export const CLASSIC_TOKENS; export const RESERVED_TOKENS; ...And you can also modify the
parser.tsif you want to add new binary operatorsexport const MULTIPLICATIVE_OPERATORS; export const ADDITIVE_OPERATORS; export const COMPARISON_OPERATORS; export const ASSIGNMENT_OPERATORS; ...
🛠️ How to use
📦 Install
First install Pridou in your project with:
npm install pridoujs📝 Example usage
Then you can use Pridou as a library in your own Node.js project:
import Pridou, { Environment } from "pridoujs"; const code = ` mut a = 1 + 2; ret a; `; const env = new Environment(); // optional const interpreter = new Pridou(env); const result = interpreter.eval(code); // or interpreter.run(code) console.log(result);
🛤️ Roadmap
- [x] Project Base
- [x] Add biomejs
- [x] Add ci
- [x] Add vitest
📎 Resources
- 📦 Npm
