.replace (and what ever fits your needs as well). To get into it step by step you should start with regular expressions and can rewrite it later with a tokenizer.
An overview of the StrexLang itself can be found in docs/language.md.
How to start
Clone this repository locally:
git clone email@example.com:MartinHelmut/strex-lang.git && cd strex-lang
or even better fork this repository. This also makes it easier to update your repository later.
After this install the necessary NPM dependencies:
Note: If you forked this repository to implement your parser it would be lovely to send a PR here to add it to the list of possible implementations made by the community
Open the file
src/parser/index.js in your favorite code editor and read the comments included that will provide further guidance.
To test your progress you can execute
npm test and see how many green you get
src/parser/__tests__. This can also provide further documentation.
Development can be done in phases to get step by step to a more and more sophisticated language.
- Basic language
- Advanced types and calculations
- Error handling
- If expressions
- Nested if expressions
- "And" and "or" if expressions
- Error messages for if expressions
- Human readable error messages
- Multi line expressions
Phases can also be tested with
npm test -- phase-01 for the first phase. If a later phase is tested all phases before are executed as well to ensure nothing broke.
npm test will execute not only all phases but the compiler tests as well. If you only want to execute compiler tests you can run
npm test -- compiler.