GitXplorerGitXplorer
P

pyjsparser

public
247 stars
38 forks
17 issues

Commits

List of commits on branch master.
Verified
cbd1e05e8227782bcca6ea71313793e2de737f0f

Merge pull request #35 from worstperson/arrowfunc

committed 2 years ago
Unverified
7bc315db467de19c6e362a9c89ed653d1c34d9af

Enable partial ES6 Arrow function support

wworstperson committed 2 years ago
Unverified
5465d037b30e334cb0997f2315ec1e451b8ad4c1

actually remove the memory hog

PPiotrDabkowski committed 5 years ago
Unverified
3f33b7a2caf4bac2355a5836cffff441d0f78084

readme

PPiotrDabkowski committed 5 years ago
Unverified
3467b656cfcafc3343b46323ff2304a12e7f9129

memory usage improvement

PPiotrDabkowski committed 5 years ago
Unverified
fc4e13e77d3f97e91ec16099241bd458644c3d6b

yapf

PPiotrDabkowski committed 5 years ago

README

The README file for this repository.

pyjsparser

Build Status

Fast JavaScript parser - manual translation of esprima.js to python. Takes 1 second to parse whole angular.js library so parsing speed is about 100k characters per second which makes it the fastest and most comprehensible JavaScript parser for python out there.

Supports whole ECMAScript 5.1 and parts of ECMAScript 6. The documentation for the generated AST can be found here.

Installation

pip install pyjsparser

Example

>>> from pyjsparser import parse
>>> parse('var $ = "Hello!"')
{
"type": "Program",
"body": [
    {
        "type": "VariableDeclaration",
        "declarations": [
            {
                "type": "VariableDeclarator",
                "id": {
                    "type": "Identifier",
                    "name": "$"
                },
                "init": {
                    "type": "Literal",
                    "value": "Hello!",
                    "raw": '"Hello!"'
                }
            }
        ],
        "kind": "var"
    }
  ]
}