From b89f4a5f3b0766be47ccd18dba376a387765ffc4 Mon Sep 17 00:00:00 2001 From: tiye Date: Wed, 19 Jun 2024 00:46:35 +0800 Subject: [PATCH] get EDN parsing strict as in Rust; tag 0.8.57 --- Cargo.lock | 10 +++++----- Cargo.toml | 4 ++-- package.json | 2 +- ts-src/js-cirru.mts | 5 ++--- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2da1c9e..3cbc237 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -94,7 +94,7 @@ checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" [[package]] name = "calcit" -version = "0.8.56" +version = "0.8.57" dependencies = [ "cirru_edn", "cirru_parser", @@ -149,18 +149,18 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.4" +version = "4.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" +checksum = "5db83dced34638ad474f39f250d7fea9598bdd239eaced1bdf45d597da0f433f" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.5.2" +version = "4.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" +checksum = "f7e204572485eb3fbf28f871612191521df159bc3e15a9f5064c66dba3a8c05f" dependencies = [ "anstream", "anstyle", diff --git a/Cargo.toml b/Cargo.toml index 9a4f264..7312e37 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "calcit" -version = "0.8.56" +version = "0.8.57" authors = ["jiyinyiyong "] edition = "2021" license = "MIT" @@ -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" diff --git a/package.json b/package.json index 5d1eb77..b2f7001 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/ts-src/js-cirru.mts b/ts-src/js-cirru.mts index 0efd83f..180b736 100644 --- a/ts-src/js-cirru.mts +++ b/ts-src/js-cirru.mts @@ -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) {