Crates.io | cirru_edn |
lib.rs | cirru_edn |
version | |
source | src |
created_at | 2021-04-15 13:37:54.268759+00 |
updated_at | 2025-01-05 18:25:46.801123+00 |
description | Parser/Writer for Cirru EDN |
homepage | http://cirru.org |
repository | https://github.com/Cirru/cirru_edn.rs |
max_upload_size | |
id | 384833 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Extensible data notations based on Cirru syntax
cargo add cirru_edn
use cirru_edn::Edn;
cirru_edn::parse("[] 1 2 true"); // Result<Edn, String>
cirru_edn::format(data, /* use_inline */ true); // Result<String, String>.
mixed data:
{} (:a 1.0)
:b $ [] 2.0 3.0 4.0
:c $ {} (:d 4.0)
:e true
:f :g
:h $ {} (|a 1.0)
|b true
{}
:b $ [] 2 3 4
:a 1
:c $ {}
:h $ {} (|b true) (|a 1)
:f :g
:e true
:d 4
for top-level literals, need to use do
expression:
do nil
do true
do false
do 1
do -1.1
quoted code:
do 'a
quote (a b)
tags(previously called "keyword")
do :a
string syntax, note it's using prefixed syntax of |
:
do |a
string with special characters:
do \"|a b\"
nested list:
[] 1 2 $ [] 3
#{} ([] 3) 1
tuple, or tagged union, actually very limitted due to Calcit semantics:
:: :a
:: :b 1
extra values can be added to tuple since 0.3
:
:: :a 1 |extra :l
a record, notice that now it's all using tags:
%{} :Demo (:a 1)
:b 2
:c $ [] 1 2 3
extra format for holding buffer, which is internally Vec<u8>
:
buf 00 01 f1 11
atom, which translates to a reference to a value:
atom 1
MIT