diff --git a/Cargo.lock b/Cargo.lock index 3aea096f..fce49025 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -36,7 +36,7 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "calcit" -version = "0.7.3" +version = "0.7.4" dependencies = [ "cirru_edn", "cirru_parser", diff --git a/Cargo.toml b/Cargo.toml index fb9c624b..bf2fffc7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "calcit" -version = "0.7.3" +version = "0.7.4" authors = ["jiyinyiyong "] edition = "2021" license = "MIT" diff --git a/calcit/test-string.cirru b/calcit/test-string.cirru index 223b6470..e1896e13 100644 --- a/calcit/test-string.cirru +++ b/calcit/test-string.cirru @@ -180,6 +180,12 @@ assert= "|:: :&core-list-class $ [] 1 2 3" trim $ format-cirru-edn $ :: &core-list-class $ [] 1 2 3 + assert= "|:: :test" + trim $ format-cirru-edn $ :: :test + + assert= "|:: :test :a :b" + trim $ format-cirru-edn $ :: :test :a :b + assert= &cirru-quote:to-list $ cirru-quote $ a b c $ d [] |a |b |c $ [] |d diff --git a/package.json b/package.json index 2af73907..a147f13f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@calcit/procs", - "version": "0.7.3", + "version": "0.7.4", "main": "./lib/calcit.procs.mjs", "devDependencies": { "@types/node": "^20.3.2", diff --git a/ts-src/calcit.procs.mts b/ts-src/calcit.procs.mts index 1df7741d..6747c61b 100644 --- a/ts-src/calcit.procs.mts +++ b/ts-src/calcit.procs.mts @@ -1,5 +1,5 @@ // CALCIT VERSION -export const calcit_version = "0.7.3"; +export const calcit_version = "0.7.4"; import { parse, ICirruNode } from "@cirru/parser.ts"; import { writeCirruCode } from "@cirru/writer.ts"; diff --git a/ts-src/js-cirru.mts b/ts-src/js-cirru.mts index ac1d9a19..3ab6711d 100644 --- a/ts-src/js-cirru.mts +++ b/ts-src/js-cirru.mts @@ -129,8 +129,10 @@ export let to_cirru_edn = (x: CalcitValue): CirruEdnFormat => { if (x.tag instanceof CalcitSymbol && x.tag.value === "quote") { // turn `x.snd` with CalcitList into raw Cirru nodes, which is in plain Array return ["quote", toWriterNode(x.get(1) as any)] as CirruEdnFormat; + } else if (x.tag instanceof CalcitTag) { + return ["::", x.tag.toString(), ...x.extra.map(to_cirru_edn)]; } else if (x.tag instanceof CalcitRecord) { - return ["::", x.tag.name.toString(), to_cirru_edn(x.get(1))]; + return ["::", x.tag.name.toString(), ...x.extra.map(to_cirru_edn)]; } else { throw new Error(`Unsupported tag for EDN: ${x.tag}`); }