Crates.io | syml |
lib.rs | syml |
version | 0.4.0 |
source | src |
created_at | 2024-04-16 22:32:37.764494 |
updated_at | 2024-04-26 07:48:10.617616 |
description | SYML is a configuration language similar to YAML, but may be more user-friendly |
homepage | |
repository | https://github.com/A4-Tacks/syml-rs |
max_upload_size | |
id | 1210771 |
size | 49,452 |
SYML is a configuration language similar to YAML, but may be more user-friendly
/ \t
\r
? \n
;
(!nl any-char)*\r
? \n
)+\
(
[\\nrt"' \t]x
hex{2}u
(hex{4} / {
hex+ }
)U
hex{8}\
comment? \r
? \n
_-
!
)'
[^'\r\n]* '
"
str_ignore* ((escape / [^\r\n\\]) str_ignore*)* "
[
_ (simple-val (_ ,
_ simple-val)* _ ,
?)? _ ]
{
_ (simple-val _ :
_ inline-value (_ ,
simple-val _ :
_ inline-value)* _ ,
?)? _ }
-
ivalue \n
(cnl indent(+2) -
ivalue(+2))*:
(_ simple-val _ :
)* (- name: jack
age: 18
- name: jones
age: 21
ids:
- - 1
- 2
- [3, 4] ; inline
like JSON5:
[
{
name: "jack",
age: "18",
},
{
name: "jones",
age: "21",
ids: [
[1, 2],
[3, 4],
]
}
]
use cli utils:
cargo install syml --features cli-utils
use lib:
let _value = syml::parser::value(r#"
; comment
- {a: 1, b: 2}
- [3, 4]
- 5
- x: 2
y: 3
"#).unwrap();