GithubHelp home page GithubHelp logo

mconca / jsparagus Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mozilla-spidermonkey/jsparagus

0.0 1.0 0.0 3.48 MB

Parser generators

Python 37.24% Rust 62.24% Shell 0.24% Makefile 0.29%

jsparagus's Introduction

Rust

jsparagus - A JavaScript parser written in Rust

jsparagus is intended to replace the JavaScript parser in Firefox.

Current status:

Join us on Discord: https://discord.gg/tUFFk9Y

Getting started

Part of jsparagus is generated by a Python script, so start by setting up your Python environment, make sure cargo-fmt is installed, then use make all to build the parser:

python3 -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt

cargo install cargo-fmt

git config core.hooksPath .githooks

make all

(Note: This takes about 3 minutes to run on my laptop. The Python script is slow. We're working on it!)

When it's done, you can:

  • Run make check to make sure things are working.

  • cd rust && cargo run to test the JS parser and bytecode emitter.

Limitations

It's all limitations, but I'll try to list the ones that are relevant to parsing JS.

  • Lookahead assertions are limited to one token. (The JS grammar contains an occasional [lookahead != `let [`] and even [lookahead != `async [no LineTerminator here] function`].)

  • Restricted productions ("[no LineTerminator here]") are not implemented yet.

  • Error messages are poor.

  • No table compaction or table optimization. There's plenty of low-hanging fruit there.

jsparagus's People

Contributors

jorendorff avatar khyperia avatar arai-a avatar codehag avatar evilpie avatar nbp avatar croraf avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.