Skip to content

Commit

Permalink
fix tuple tag in cirru-edn; tag 0.7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
tiye committed Jul 2, 2023
1 parent 4c32088 commit ac62e1d
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "calcit"
version = "0.7.3"
version = "0.7.4"
authors = ["jiyinyiyong <[email protected]>"]
edition = "2021"
license = "MIT"
Expand Down
6 changes: 6 additions & 0 deletions calcit/test-string.cirru
Original file line number Diff line number Diff line change
Expand Up @@ -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
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.7.3",
"version": "0.7.4",
"main": "./lib/calcit.procs.mjs",
"devDependencies": {
"@types/node": "^20.3.2",
Expand Down
2 changes: 1 addition & 1 deletion ts-src/calcit.procs.mts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
4 changes: 3 additions & 1 deletion ts-src/js-cirru.mts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
}
Expand Down

0 comments on commit ac62e1d

Please sign in to comment.