|
|
|
[package]
|
|
|
|
name = "boa_engine"
|
|
|
|
version = "0.15.0"
|
|
|
|
edition = "2021"
|
|
|
|
rust-version = "1.60"
|
|
|
|
authors = ["boa-dev"]
|
|
|
|
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/boa-dev/boa"
|
|
|
|
keywords = ["javascript", "js", "compiler", "lexer", "parser"]
|
|
|
|
categories = ["parser-implementations", "compilers"]
|
|
|
|
license = "Unlicense/MIT"
|
|
|
|
readme = "../README.md"
|
|
|
|
|
|
|
|
[features]
|
|
|
|
profiler = ["boa_profiler/profiler"]
|
Lexer string interning (#1758)
This Pull Request is part of #279.
It adds a string interner to Boa, which allows many types to not contain heap-allocated strings, and just contain a `NonZeroUsize` instead. This can move types to the stack (hopefully I'll be able to move `Token`, for example, maybe some `Node` types too.
Note that the internet is for now only available in the lexer. Next steps (in this PR or future ones) would include also using interning in the parser, and finally in execution. The idea is that strings should be represented with a `Sym` until they are displayed.
Talking about display. I have changed the `ParseError` type in order to not contain anything that could contain a `Sym` (basically tokens), which might be a bit faster, but what is important is that we don't depend on the interner when displaying errors.
The issue I have now is in order to display tokens. This requires the interner if we want to know identifiers, for example. The issue here is that Rust doesn't allow using a `fmt::Formatter` (only in nightly), which is making my head hurt. Maybe someone of you can find a better way of doing this.
Then, about `cursor.expect()`, this is the only place where we don't have the expected token type as a static string, so it's failing to compile. We have the option of changing the type definition of `ParseError` to contain an owned string, but maybe we can avoid this by having a `&'static str` come from a `TokenKind` with the default values, such as "identifier" for an identifier. I wanted for you to think about it and maybe we can just add that and avoid allocations there.
Oh, and this depends on the VM-only branch, so that has to be merged before :)
Another thing to check: should the interner be in its own module?
3 years ago
|
|
|
deser = ["boa_interner/serde"]
|
|
|
|
intl = [
|
|
|
|
"dep:icu_locale_canonicalizer",
|
|
|
|
"dep:icu_locid",
|
|
|
|
"dep:icu_datetime",
|
|
|
|
"dep:icu_plurals",
|
|
|
|
"dep:icu_provider",
|
|
|
|
"dep:icu_testdata",
|
|
|
|
"dep:sys-locale"
|
|
|
|
]
|
|
|
|
|
|
|
|
# Enable Boa's WHATWG console object implementation.
|
|
|
|
console = []
|
|
|
|
|
|
|
|
[dependencies]
|
|
|
|
boa_unicode = { path = "../boa_unicode", version = "0.15.0" }
|
|
|
|
boa_interner = { path = "../boa_interner", version = "0.15.0" }
|
|
|
|
boa_gc = { path = "../boa_gc", version = "0.15.0" }
|
|
|
|
gc = "0.4.1"
|
|
|
|
boa_profiler = { path = "../boa_profiler", version = "0.15.0" }
|
|
|
|
serde = { version = "1.0.144", features = ["derive", "rc"] }
|
|
|
|
serde_json = "1.0.85"
|
|
|
|
rand = "0.8.5"
|
Bump num-traits from 0.2.14 to 0.2.15 (#2056)
Bumps [num-traits](https://github.com/rust-num/num-traits) from 0.2.14 to 0.2.15.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/rust-num/num-traits/blob/master/RELEASES.md">num-traits's changelog</a>.</em></p>
<blockquote>
<h1>Release 0.2.15 (2022-05-02)</h1>
<ul>
<li><a href="https://github-redirect.dependabot.com/rust-num/num-traits/pull/195">The new <code>Euclid</code> trait calculates Euclidean division</a>, where the
remainder is always positive or zero.</li>
<li><a href="https://github-redirect.dependabot.com/rust-num/num-traits/pull/210">The new <code>LowerBounded</code> and <code>UpperBounded</code> traits</a> separately describe
types with lower and upper bounds. These traits are automatically implemented
for all fully-<code>Bounded</code> types.</li>
<li><a href="https://github-redirect.dependabot.com/rust-num/num-traits/pull/207">The new <code>Float::copysign</code> method copies the sign of the argument</a> to
to the magnitude of <code>self</code>.</li>
<li><a href="https://github-redirect.dependabot.com/rust-num/num-traits/pull/205">The new <code>PrimInt::leading_ones</code> and <code>trailing_ones</code> methods</a> are the
complement of the existing methods that count zero bits.</li>
<li><a href="https://github-redirect.dependabot.com/rust-num/num-traits/pull/202">The new <code>PrimInt::reverse_bits</code> method reverses the order of all bits</a>
of a primitive integer.</li>
<li><a href="https://github-redirect.dependabot.com/rust-num/num-traits/pull/201">Improved <code>Num::from_str_radix</code> for floats</a>, also <a href="https://github-redirect.dependabot.com/rust-num/num-traits/pull/214">ignoring case</a>.</li>
<li><a href="https://github-redirect.dependabot.com/rust-num/num-traits/pull/196"><code>Float</code> and <code>FloatCore</code> use more from <code>libm</code></a> when that is enabled.</li>
</ul>
<p><strong>Contributors</strong>: <a href="https://github.com/alion02"><code>@alion02</code></a>, <a href="https://github.com/clarfonthey"><code>@clarfonthey</code></a>, <a href="https://github.com/cuviper"><code>@cuviper</code></a>, <a href="https://github.com/ElectronicRU"><code>@ElectronicRU</code></a>,
<a href="https://github.com/ibraheemdev"><code>@ibraheemdev</code></a>, <a href="https://github.com/SparrowLii"><code>@SparrowLii</code></a>, <a href="https://github.com/sshilovsky"><code>@sshilovsky</code></a>, <a href="https://github.com/tspiteri"><code>@tspiteri</code></a>, <a href="https://github.com/XAMPPRocky"><code>@XAMPPRocky</code></a>, <a href="https://github.com/Xiretza"><code>@Xiretza</code></a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/rust-num/num-traits/commit/1597c1c4d1b3e33548e4661c519b7246a5fc1c28"><code>1597c1c</code></a> Merge <a href="https://github-redirect.dependabot.com/rust-num/num-traits/issues/236">#236</a></li>
<li><a href="https://github.com/rust-num/num-traits/commit/4a2e648d9325810dcaf627f743c0fc5df066a820"><code>4a2e648</code></a> Release 0.2.15</li>
<li><a href="https://github.com/rust-num/num-traits/commit/edb4821d42bfd055792a72234798b76b8068fe56"><code>edb4821</code></a> Merge <a href="https://github-redirect.dependabot.com/rust-num/num-traits/issues/207">#207</a></li>
<li><a href="https://github.com/rust-num/num-traits/commit/e4e52de40fdf4fa5f2ef260a482cf51c915581c5"><code>e4e52de</code></a> Fix copysign tests for 1.8.0</li>
<li><a href="https://github.com/rust-num/num-traits/commit/30077120f96ff00de46cab3c6ce693eb892c18bd"><code>3007712</code></a> Don't use an explicit copysign feature</li>
<li><a href="https://github.com/rust-num/num-traits/commit/30f8d3ab4bfb590f742f592309109e00b207b23d"><code>30f8d3a</code></a> Make sure test_copysignf uses Float</li>
<li><a href="https://github.com/rust-num/num-traits/commit/70b5c579ab6a001435208d8d3811407c8f07fa94"><code>70b5c57</code></a> Update float.rs</li>
<li><a href="https://github.com/rust-num/num-traits/commit/cabfb0b90497ba5d908d14a908dd269f03cc5f4d"><code>cabfb0b</code></a> Update float.rs</li>
<li><a href="https://github.com/rust-num/num-traits/commit/7ca2456e9c1b3f89a6bb749fc54d8a153ff51704"><code>7ca2456</code></a> Update float.rs</li>
<li><a href="https://github.com/rust-num/num-traits/commit/64db6c32936c1cd00c3074b847e10c7e6f8b20b3"><code>64db6c3</code></a> Add copysign</li>
<li>Additional commits viewable in <a href="https://github.com/rust-num/num-traits/compare/num-traits-0.2.14...num-traits-0.2.15">compare view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=num-traits&package-manager=cargo&previous-version=0.2.14&new-version=0.2.15)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
</details>
3 years ago
|
|
|
num-traits = "0.2.15"
|
|
|
|
regress = "0.4.1"
|
|
|
|
rustc-hash = "1.1.0"
|
|
|
|
num-bigint = { version = "0.4.3", features = ["serde"] }
|
|
|
|
num-integer = "0.1.45"
|
|
|
|
bitflags = "1.3.2"
|
|
|
|
indexmap = "1.9.1"
|
|
|
|
ryu-js = "0.2.2"
|
|
|
|
chrono = "0.4.22"
|
|
|
|
fast-float = "0.2.0"
|
|
|
|
unicode-normalization = "0.1.21"
|
|
|
|
dyn-clone = "1.0.9"
|
|
|
|
once_cell = "1.14.0"
|
|
|
|
tap = "1.0.1"
|
|
|
|
icu_locale_canonicalizer = { version = "0.6.0", features = ["serde"], optional = true }
|
|
|
|
icu_locid = { version = "0.6.0", features = ["serde"], optional = true }
|
|
|
|
icu_datetime = { version = "0.6.0", features = ["serde"], optional = true }
|
|
|
|
icu_plurals = { version = "0.6.0", features = ["serde"], optional = true }
|
|
|
|
icu_provider = { version = "0.6.0", optional = true }
|
|
|
|
icu_testdata = { version = "0.6.0", optional = true }
|
|
|
|
sys-locale = { version = "0.2.1", optional = true }
|
|
|
|
|
|
|
|
[dev-dependencies]
|
|
|
|
criterion = "0.4.0"
|
|
|
|
float-cmp = "0.9.0"
|
|
|
|
|
|
|
|
[target.x86_64-unknown-linux-gnu.dev-dependencies]
|
|
|
|
jemallocator = "0.5.0"
|
|
|
|
|
|
|
|
[lib]
|
|
|
|
crate-type = ["cdylib", "lib"]
|
|
|
|
name = "boa_engine"
|
|
|
|
bench = false
|
|
|
|
|
|
|
|
[[bench]]
|
|
|
|
name = "full"
|
|
|
|
harness = false
|