GitXplorerGitXplorer
t

okapi

public
21 stars
0 forks
0 issues

Commits

List of commits on branch main.
Unverified
f140ef1c05a75fd0dfb6867fe30607cbc38813f5

Update licence

tthegreatercurve committed 2 months ago
Unverified
404e172484c19d27e0dc018e603eb3a1e415cc0d

Fix spelling error

tthegreatercurve committed 6 months ago
Unverified
ebd1ae7803cf9ea5f7cb54d4a6c6d0e1bceebe5a

Add READMEs

tthegreatercurve committed 6 months ago
Unverified
b17ce82eedf33b7dec65979d6e3d788eca16cbb9

Rename crates

tthegreatercurve committed 6 months ago
Unverified
e0b76ce50caf54733e5290324ab7d03400a6ec6c

Fix issues with parsing template literals

tthegreatercurve committed 6 months ago
Unverified
f91fe955e5c31b079b52c602c92b218e0480fdce

Improve parsing of let as identifier

tthegreatercurve committed 7 months ago

README

The README file for this repository.

Okapi JS Parser

[!NOTE] This is a parser is still a work-in-progress and should not be used in production.

A lightweight but production-grade JavaScript parser for Rust and WebAssembly.

The library fully supports ECMAScript 2024 and it outputs it's Abstract Syntax Tree (AST) as either normal ESTree compliant structs or as JSON using serde_json.

ESTree is a community-maintained and widely-used standard for ASTs, and is the same output as most other JavaScript parsers.

Below are listed some of the aims and achievements of this project:

Usage

use okapi_js_parser::Parser;

let source_str: &str = ...

let mut parser = Parser::new(source_str);

match parser.parse_script() {
    Ok(program) => ...,
    Err(err) => ...,
}

Tests

To run the local parser and lexer tests:

cargo test

To run the tests for Test262:

cargo run -p okapi_test262

Playground

The local web playground to test the parser functionality can be found in ./playground.

Instructions on how to set-up the playground can be found in the associated README.md.