v0.1.1
Giron is an ECMAScript parser written in Rust which outputs Rust strucs or JSON in the ESTree specification format.
The giron-wasm
provides the compiled .wasm binary and javascript interface for using the giron parser on the web.
Note: giron is a work in progress.
This repository is looking for contributors. There's still a lot of work to be done, but some of the priorities right now are:
Get from crates.io: https://crates.io/crates/giron
Once you add giron
to your Cargo.toml,
Basic Usage:
```rs use giron::{parsemodule, parsescript};
fn main() { let source = String::from("const PI = 3.14;"); parse_script(source).unwrap(); } ```
Giron Errors:
```rs use giron::{parsemodule, parsescript, GironError, EstreeNode};
fn analyzeast() -> Result
Parse contents of a javascript file:
```rs use giron::{parsemodule, parsescript}; use std::fs;
fn main() { let source = fs::readtostring("example-file.js").unwrap(); parse_script(source).unwrap(); } ```