Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ECMAScript parsing infrastructure for multipurpose analysis

License

Unknown, BSD-2-Clause licenses found

Licenses found

Unknown
LICENSE
BSD-2-Clause
LICENSE.BSD
NotificationsYou must be signed in to change notification settings

Kronuz/esprima-python

Repository files navigation

DonatePyPI VersionPyPI LicensePyPI FormatPyPI Status

Esprima (esprima.org, BSD license) is ahigh performance, standard-compliantECMAScriptparser officially written in ECMAScript (also popularly known asJavaScript) and ported toPython. Esprima is created and maintained byAriyaHidayat, with the help ofmanycontributors.

Python port is a line-by-line manual translation and was created and ismaintained byGerman Mendez Bravo(Kronuz).

Features

Installation

pip install esprima

API

Esprima can be used to performlexicalanalysis(tokenization) orsyntacticanalysis (parsing) of aJavaScript program.

A simple example:

>>>importesprima>>>program='const answer = 42'>>>esprima.tokenize(program)[{type:"Keyword",value:"const"},{type:"Identifier",value:"answer"},{type:"Punctuator",value:"="},{type:"Numeric",value:"42"}]>>>esprima.parseScript(program){body:[{kind:"const",declarations:[{init:{raw:"42",type:"Literal",value:42},type:"VariableDeclarator",id:{type:"Identifier",name:"answer"}}],type:"VariableDeclaration"}],type:"Program",sourceType:"script"}

For more information, please read thecompletedocumentation.

About

ECMAScript parsing infrastructure for multipurpose analysis

Topics

Resources

License

Unknown, BSD-2-Clause licenses found

Licenses found

Unknown
LICENSE
BSD-2-Clause
LICENSE.BSD

Stars

Watchers

Forks

Packages

No packages published

Contributors7

Languages


[8]ページ先頭

©2009-2025 Movatter.jp