Skip to content

Commit

Permalink
Merge pull request #245 from calcit-lang/edn-strict
Browse files Browse the repository at this point in the history
get EDN parsing strict as in Rust
  • Loading branch information
NoEgAm authored Jun 19, 2024
2 parents 2427b88 + b89f4a5 commit 6c86e4e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
10 changes: 5 additions & 5 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "calcit"
version = "0.8.56"
version = "0.8.57"
authors = ["jiyinyiyong <[email protected]>"]
edition = "2021"
license = "MIT"
Expand All @@ -24,7 +24,7 @@ cirru_edn = "0.6.10"
# cirru_edn = { path = "/Users/chenyong/repo/cirru/edn.rs" }
cirru_parser = "0.1.31"
# cirru_parser = { path = "/Users/chenyong/repo/cirru/parser.rs" }
clap = "4.5.4"
clap = "4.5.7"
dirs = "5.0.1"
lazy_static = "1.4.0"
notify = "6.1.1"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@calcit/procs",
"version": "0.8.56",
"version": "0.8.57",
"main": "./lib/calcit.procs.mjs",
"devDependencies": {
"@types/node": "^20.11.28",
Expand Down
5 changes: 2 additions & 3 deletions ts-src/js-cirru.mts
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,8 @@ export let extract_cirru_edn = (x: CirruEdnFormat, options: CalcitValue): Calcit
if (x.match(/^(-?)\d+(\.\d*$)?/)) {
return parseFloat(x);
}
// allow things cannot be parsed accepted as raw strings
// turned on since Cirru nodes passed from macros uses this
return x;
// strict behavior as Rust semantics
throw new Error("unknown syntax for EDN");
}
if (x instanceof Array) {
if (x.length === 0) {
Expand Down

0 comments on commit 6c86e4e

Please sign in to comment.