Coder Social home page Coder Social logo

esparse's Introduction

esparse

esparse is a parser for the ECMAScript programming language, written in JavaScript. Given a string representing a JavaScript program, it will output an abstract syntax tree representing that program.

Project Goals

The primary goal of this project is to implement an ECMAScript parser:

  • Whose source code is clear, easy to follow, and aesthetically pleasing.
  • That is easy to extend or modify for language experimentation purposes.
  • That provides an AST structure which is easy to traverse, easy to manipulate, and is convenient for a wide variety of code transformation use cases.
  • Whose performance is comparable to other modern ECMAScript parsers which are written in JavaScript.

AST compatibility with other parsers is not a project goal. However, it is expected that any future changes to the AST protocol will be backward compatible with previous versions.

Hacking

This is a work-in-progress. If you run into any problems getting started, please file an issue so that we can get it resolved as soon as possible.

For now, the development workflow depends on esdown, a minimal and transparent ES6+-to-ES5 compiler.

Getting Started

  1. Install esdown, either manually or using npm. Take a look at the esdown README to get a feel for the command syntax.

    npm install -g esdown
    
  2. Fork this repository.

  3. From within the project root folder, run:

    esdown test
    

    This will execute the test runner located at test/default.js.

  4. Start hacking the source code and have fun!

Adding Tests

All tests are located in subject-specific directories under the test folder. Adding a new file to any folder within test will automatically add it to the test suite.

Building

Run the following command from the project root to translate and bundle the library into a single ES5-compatible script:

esdown build

This will execute a simple build script located at build/default.js.

esparse's People

Contributors

mathiasbynens avatar zenparsing avatar

Watchers

 avatar  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.