Skip to content

Commit

Permalink
use colon as a tuple shorthand; tag 0.7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
tiye committed Jun 18, 2023
1 parent 131d1ac commit aff900c
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 9 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.1"
version = "0.7.2"
authors = ["jiyinyiyong <[email protected]>"]
edition = "2021"
license = "MIT"
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.1",
"version": "0.7.2",
"main": "./lib/calcit.procs.mjs",
"devDependencies": {
"@types/node": "^20.2.5",
Expand Down
7 changes: 7 additions & 0 deletions src/cirru/calcit-core.cirru
Original file line number Diff line number Diff line change
Expand Up @@ -1817,3 +1817,10 @@
if (some? y)
range (inc (&- (&+ x x) y)) y
range (inc (negate x)) x

|: $ quote
defmacro : (tag & args)
quasiquote
::
~ $ turn-tag tag
~@ args
2 changes: 1 addition & 1 deletion src/data/cirru.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub fn code_to_calcit(xs: &Cirru, ns: Arc<str>, def: Arc<str>, coord: &[u8]) ->
location: Some(coord.to_vec()),
}),
_ => match s.chars().next().expect("load first char") {
':' => Ok(Calcit::tag(&s[1..])),
':' if s.len() > 1 && s.chars().nth(1) != Some(':') => Ok(Calcit::tag(&s[1..])),
'.' => {
if let Some(stripped) = s.strip_prefix(".-") {
Ok(Calcit::Method(stripped.into(), MethodKind::Access))
Expand Down
6 changes: 2 additions & 4 deletions src/primes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,10 @@ impl fmt::Display for Calcit {
Calcit::Tuple(tag, extra, _class) => {
let mut extra_str = String::from("");
for item in extra {
if !extra_str.is_empty() {
extra_str.push(' ');
}
extra_str.push(' ');
extra_str.push_str(&item.to_string())
}
f.write_str(&format!("(:: {tag} {extra_str})"))
f.write_str(&format!("(:: {tag}{extra_str})"))
}
Calcit::Buffer(buf) => {
f.write_str("(&buffer")?;
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.1";
export const calcit_version = "0.7.2";

import { parse, ICirruNode } from "@cirru/parser.ts";
import { writeCirruCode } from "@cirru/writer.ts";
Expand Down

0 comments on commit aff900c

Please sign in to comment.