Skip to content

Commit

Permalink
Fix extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
rscarson committed Sep 13, 2023
1 parent 234490f commit 032fcb7
Show file tree
Hide file tree
Showing 35 changed files with 2,609 additions and 2,987 deletions.
95 changes: 52 additions & 43 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

78 changes: 39 additions & 39 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
[package]
name = "lavendeux-parser"
description = "Extensible parsing engine for expression evaluation"
license = "MIT OR Apache-2.0"
keywords = ["parser", "text", "math"]
categories = ["parser-implementations", "development-tools", "command-line-utilities", "encoding"]
homepage = "https://rscarson.github.io/Lavendeux/"
repository = "https://github.com/rscarson/lavendeux-parser"
readme = "readme.md"
version = "0.9.0"
edition = "2021"

[features]
default = ["extensions", "crypto-functions", "encoding-functions"]
extensions = ["js-sandbox"]
crypto-functions = ["md-5", "sha2"]
encoding-functions = ["base64", "urlencoding"]

[dependencies]
regex = "1.7.2"
pest = "2.5.6"
pest_derive = "2.5.6"
serde = { version = "1.0.160", features = ["derive"] }
serde_json = "1.0.96"
reqwest = { version = "0.11.15", features = ["blocking"] }
chrono = "0.4.23"
rand = "0.8.5"

# Feature deps
#js-sandbox = { version = "0.2.0-rc.0", optional = true }
js-sandbox = {optional = true, git = "https://github.com/rscarson/js-sandbox"}
md-5 = { version = "0.10.5", optional = true }
sha2 = { version = "0.10.6", optional = true }
base64 = { version = "0.21.0", optional = true }
urlencoding = { version = "2.1.2", optional = true }

[dev-dependencies]
version-sync = "0.9.4"
cargo-readme = "3.2.0"
[package]
name = "lavendeux-parser"
description = "Extensible parsing engine for expression evaluation"
license = "MIT OR Apache-2.0"
keywords = ["parser", "text", "math"]
categories = ["parser-implementations", "development-tools", "command-line-utilities", "encoding"]
homepage = "https://rscarson.github.io/Lavendeux/"
repository = "https://github.com/rscarson/lavendeux-parser"
readme = "readme.md"
version = "0.9.0"
edition = "2021"

[features]
default = ["extensions", "crypto-functions", "encoding-functions"]
extensions = ["js-sandbox"]
crypto-functions = ["md-5", "sha2"]
encoding-functions = ["base64", "urlencoding"]

[dependencies]
regex = "1.7.2"
pest = "2.5.6"
pest_derive = "2.5.6"
serde = { version = "1.0.160", features = ["derive"] }
serde_json = "1.0.96"
reqwest = { version = "0.11.15", features = ["blocking"] }
chrono = "0.4.23"
rand = "0.8.5"

# Feature deps
#js-sandbox = { version = "0.2.0-rc.0", optional = true }
js-sandbox = {optional = true, git = "https://github.com/rscarson/js-sandbox"}
md-5 = { version = "0.10.5", optional = true }
sha2 = { version = "0.10.6", optional = true }
base64 = { version = "0.21.0", optional = true }
urlencoding = { version = "2.1.2", optional = true }

[dev-dependencies]
version-sync = "0.9.4"
cargo-readme = "3.2.0"
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ be extended easily at runtime through extensions written in javascript.
Extensions are run in a sandboxed environment with no host or network access.
This project is the engine behind [Lavendeux](https://rscarson.github.io/lavendeux/).

Try it out using ```cargo run --example interactive_console```

### Getting Started
To use it, create a `ParserState` object, and use it to tokenize input with `Token::new`:
```rust
Expand Down Expand Up @@ -243,6 +245,7 @@ factorial(5)
Decorators can be put at the end of a line to change the output format. Valid decorators include:
```
255 @hex // The result will be 0xFF
1647950086 @utc // 2022-03-22 11:54:46
8 @oct // The result will be 0o10
5 @float // The result will be 5.0
5 @usd // Also works with @dollars @cad, @aud, @yen, @pounds, or @euros
Expand Down
Loading

0 comments on commit 032fcb7

Please sign in to comment.