2020-04-15 16:15:56 +10:00
|
|
|
# Jasmine Snake
|
|
|
|
Another JavaScript interpreter written on Python 3.
|
|
|
|
|
|
|
|
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
|
|
|
|
[![SemVer: 2.0.0](https://img.shields.io/badge/SemVer-2.0.0-F8DE7E?labelColor=23261D)](https://semver.org/spec/v2.0.0.html)
|
|
|
|
|
|
|
|
## Requirements
|
|
|
|
|
|
|
|
- ANTLR 4
|
|
|
|
- Colorama
|
|
|
|
|
|
|
|
To run tests:
|
|
|
|
|
2020-06-26 16:24:06 +10:00
|
|
|
- pytest
|
2020-04-15 16:15:56 +10:00
|
|
|
- Tox
|
|
|
|
|
|
|
|
You can get ANTLR [here](https://www.antlr.org/), other dependencies could be installed with pip:
|
|
|
|
```bash
|
|
|
|
pip install -r requirements.txt # Use requirements-dev.txt if you want to run tests
|
|
|
|
```
|
|
|
|
|
|
|
|
## Running
|
|
|
|
|
|
|
|
```bash
|
2020-04-27 23:07:15 +10:00
|
|
|
antlr4 -Xexact-output-dir -o jasminesnake/lex -package lex -Dlanguage=Python3 -listener grammars/*.g4
|
2020-04-15 16:15:56 +10:00
|
|
|
python -m jasminesnake
|
|
|
|
```
|
|
|
|
|
|
|
|
## Credits
|
|
|
|
|
2020-04-27 23:13:42 +10:00
|
|
|
ESTree specification:
|
|
|
|
[https://github.com/estree/estree/](https://github.com/estree/estree/)
|
|
|
|
|
2020-04-15 16:15:56 +10:00
|
|
|
JavaScript grammar source:
|
|
|
|
[https://github.com/antlr/grammars-v4/tree/master/javascript/javascript](https://github.com/antlr/grammars-v4/tree/master/javascript/javascript)
|
2020-04-15 16:45:22 +10:00
|
|
|
|
|
|
|
The snake:
|
|
|
|
[https://textart.io/art/lnl9xe1OsKIow7xPGeWDrAeF/snake](https://textart.io/art/lnl9xe1OsKIow7xPGeWDrAeF/snake)
|