@panini-bhasha/core
v0.3.2
Published
Panini - the Indian programming language.
Downloads
3
Readme
Panini - Indian programming language
Requirements for using Panini compiler
- NodeJS (version >= 16.0.0)
- npm (version >= 7.18.1)
Using Panini compiler
- Install with the following command
$ npm install -g @panini-bhasha/core
- Usage
$ panini <file name>
Requirements and setup for contributing to Panini
- NodeJS (version >= 16.0.0)
- npm (version >= 7.18.1)
- TypeScript (version >= 4.4.2)
Install with the following command
$ npm install -g typescript
- Jasmine (version >= 3.9.0) Install with the following command
$ npm install -g jasmine
- After cloning the repo run the following command to install all devDependencies
$ cd panini-clone-location
$ npm install
Adding support for new Indian language
- Create a branch and check it out. Make sure your working branch (existing or newly created) has the latest changes from
main
before making any changes. - Add language to
src/language.ts
- Create file with language's name under
src/rules
directory. For example, to add support for theతెలుగు
(Telugu) language, create filesrc/rules/తెలుగు.ts
.
Note: the file's name should match with the enum added in step 1. - Add the syntax rules in the file created above. Rules map should be named like
<language>_RulesMap
. Forతెలుగు
it would be namedతెలుగు_RulesMap
.
Note: be careful to add the rule forTokenType.ModuleStart
such that it creates well-knownaction
andgoto
table entries. Read theparse
function's comments insrc/parser.ts
for more details. - Import the rules created above in
src/rules.ts
- Export the rules created above from
src/index.ts
- Add rules created above to
src/firstSet.ts
- Add token generation to
src/lexer.ts
and token types tosrc/token/tokenType.ts
. - Add appropriate syntax error messages in
src/errors/syntaxError.ts
and semantic analysis steps insrc/parser.ts
- Add correct steps for transpilation under
src/transpiler.ts
- Run tests.
$ npm test
- Add thorough tests in the required
spec.ts
files and verify no existing tests are broken. Create new test files if required. New test files are most likely required for changes made toparser.ts
andtranspiler.ts
- Make sure all the tests pass. AGAIN.
- Sync your working branch with
main
branch AGAIN before committing any code. To allow GitHub to automatically link an issue to a commit and help us in tracking why a particular change was done, commit message should be of the format
$ git commit -m "Issue #<issue number>: <message>"
- Do NOT push changes directly to
main
branch. - Submit a pull request to the
main
branch.