-
-
Notifications
You must be signed in to change notification settings - Fork 407
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved to a workspace architecture (#247)
* Moved to a workspace architecture
- Loading branch information
Showing
51 changed files
with
541 additions
and
452 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,28 @@ | ||
[package] | ||
name = "Boa" | ||
version = "0.5.1" | ||
authors = ["Jason Williams <jase.williams@gmail.com>"] | ||
description = "Boa is a Javascript lexer, parser and Just-in-Time compiler written in Rust. Currently, it has support for some of the language." | ||
homepage = "https://github.com/jasonwilliams/boa" | ||
repository = "https://github.com/jasonwilliams/boa" | ||
keywords = ["javascript", "compiler", "lexer", "parser", "js"] | ||
license = "Unlicense/MIT" | ||
exclude = [".vscode/*", "Dockerfile", "Makefile", ".editorConfig"] | ||
edition = "2018" | ||
default-run = "boa" | ||
|
||
[features] | ||
default = ["wasm-bindgen"] | ||
|
||
[dependencies] | ||
gc = "^0.3.3" | ||
gc_derive = "^0.3.2" | ||
serde_json = "^1.0.40" | ||
rand = "^0.7.0" | ||
regex = "^1.3.0" | ||
structopt = "0.3.2" | ||
|
||
# Optional Dependencies | ||
wasm-bindgen = { version = "^0.2.50", optional = true } | ||
|
||
[dev-dependencies] | ||
criterion = "^0.3.0" | ||
|
||
[lib] | ||
crate-type = ["cdylib", "lib"] | ||
name = "boa" | ||
path = "src/lib/lib.rs" | ||
bench = false | ||
|
||
[[bench]] | ||
name = "string" | ||
harness = false | ||
|
||
[[bench]] | ||
name = "fib" | ||
harness = false | ||
|
||
[[bench]] | ||
name = "exec" | ||
harness = false | ||
|
||
[[bench]] | ||
name = "parser" | ||
harness = false | ||
|
||
[[bin]] | ||
name = "boa" | ||
path = "src/bin/bin.rs" | ||
bench = false | ||
|
||
[[bin]] | ||
name = "boashell" | ||
path = "src/bin/shell.rs" | ||
bench = false | ||
[workspace] | ||
members = [ | ||
"boa", | ||
"boa_cli", | ||
] | ||
|
||
# The release profile, used for `cargo build`. | ||
[profile.dev] | ||
incremental = true | ||
opt-level = 0 | ||
debug = true | ||
rpath = false | ||
lto = false | ||
debug-assertions = true | ||
overflow-checks = true | ||
panic = 'unwind' | ||
|
||
# The release profile, used for `cargo build --release`. | ||
[profile.release] | ||
incremental = false | ||
opt-level = 3 | ||
debug = false | ||
rpath = false | ||
codegen-units = 1 | ||
lto = true | ||
debug-assertions = false | ||
overflow-checks = false | ||
panic = 'unwind' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
[package] | ||
name = "Boa" | ||
version = "0.5.1" | ||
authors = ["Jason Williams <jase.williams@gmail.com>"] | ||
description = "Boa is a Javascript lexer, parser and Just-in-Time compiler written in Rust. Currently, it has support for some of the language." | ||
repository = "https://github.com/jasonwilliams/boa" | ||
keywords = ["javascript", "compiler", "lexer", "parser", "js"] | ||
categories = ["parser-implementations", "wasm"] | ||
license = "Unlicense/MIT" | ||
exclude = ["../.vscode/*", "../Dockerfile", "../Makefile", "../.editorConfig"] | ||
edition = "2018" | ||
|
||
[features] | ||
default = ["wasm-bindgen"] | ||
|
||
[dependencies] | ||
gc = "0.3.3" | ||
gc_derive = "0.3.2" | ||
serde_json = "1.0.46" | ||
rand = "0.7.3" | ||
regex = "1.3.4" | ||
|
||
# Optional Dependencies | ||
wasm-bindgen = { version = "0.2.58", optional = true } | ||
|
||
[dev-dependencies] | ||
criterion = "0.3.1" | ||
|
||
[lib] | ||
crate-type = ["cdylib", "lib"] | ||
name = "boa" | ||
bench = false | ||
|
||
[[bench]] | ||
name = "string" | ||
harness = false | ||
|
||
[[bench]] | ||
name = "fib" | ||
harness = false | ||
|
||
[[bench]] | ||
name = "exec" | ||
harness = false | ||
|
||
[[bench]] | ||
name = "parser" | ||
harness = false |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[package] | ||
name = "boa_cli" | ||
version = "0.1.0" | ||
authors = ["razican <iban.eguia@cern.ch>"] | ||
description = "Boa is a Javascript lexer, parser and Just-in-Time compiler written in Rust. Currently, it has support for some of the language." | ||
repository = "https://github.com/jasonwilliams/boa" | ||
keywords = ["javascript", "compiler", "lexer", "parser", "js", "cli"] | ||
categories = ["command-line-utilities"] | ||
license = "Unlicense/MIT" | ||
exclude = ["../.vscode/*", "../Dockerfile", "../Makefile", "../.editorConfig"] | ||
edition = "2018" | ||
|
||
[dependencies] | ||
Boa = { path = "../boa" } | ||
structopt = "0.3.9" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#![deny(unused_qualifications, clippy::correctness, clippy::style)] | ||
#![warn(clippy::perf)] | ||
#![allow(clippy::cognitive_complexity)] | ||
|
||
use boa::{exec, exec::Executor, forward_val, realm::Realm}; | ||
use std::{fs::read_to_string, path::PathBuf}; | ||
use structopt::StructOpt; | ||
|
||
/// CLI configuration for Boa. | ||
#[derive(Debug, StructOpt)] | ||
#[structopt(author, about)] | ||
struct Opt { | ||
/// The javascript file to be evaluated. | ||
#[structopt(name = "FILE", parse(from_os_str), default_value = "tests/js/test.js")] | ||
file: PathBuf, | ||
/// Open a boa shell (WIP). | ||
#[structopt(short, long)] | ||
shell: bool, | ||
} | ||
|
||
pub fn main() -> Result<(), std::io::Error> { | ||
let args = Opt::from_args(); | ||
|
||
let buffer = read_to_string(args.file)?; | ||
|
||
if args.shell { | ||
let realm = Realm::create(); | ||
let mut engine = Executor::new(realm); | ||
|
||
match forward_val(&mut engine, &buffer) { | ||
Ok(v) => print!("{}", v.to_string()), | ||
Err(v) => eprint!("{}", v.to_string()), | ||
} | ||
} else { | ||
dbg!(exec(&buffer)); | ||
} | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters