https://github.com/stsysd/yacl
https://github.com/stsysd/yacl
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/stsysd/yacl
- Owner: stsysd
- Created: 2021-09-07T16:28:38.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-09-12T12:11:30.000Z (almost 5 years ago)
- Last Synced: 2024-05-12T20:34:42.103Z (about 2 years ago)
- Language: JavaScript
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Yet Another Configuration Language
"yacl" is a JSON compatible, hcl-like syntax, and human readable configuration language.
A example is like this.
```hcl
digit = 123
binary = 0b111
octal = 0o123
Hex = 0x123
float = 3.14
exp = 10e-12
str = "hello"
doc = """
foo
bar
baz
"""
t = true
f = false
n = null
list = [1, 2, 3, true]
table = { foo: "bar", baz: "qux" }
block {
value = 1
nested {
value = 2
}
}
block merge {
foo = true
}
block merge {
bar = false
}
block append [] {
name = "taro"
age = 30
}
block append [] {
name = "jiro"
age = 25
}
```
This is equivalent to this JSON.
```json
{
"digit": 123,
"binary": 7,
"octal": 83,
"Hex": 291,
"float": 3.14,
"exp": 1e-11,
"str": "hello",
"doc": "foo\nbar\n baz",
"t": "true",
"f": "false",
"n": null,
"list": [
1,
2,
3,
"true"
],
"table": {
"foo": "bar",
"baz": "qux"
},
"block": {
"value": 1,
"nested": {
"value": 2
},
"merge": {
"foo": "true",
"bar": "false"
},
"append": [
{
"name": "taro",
"age": 30
},
{
"name": "jiro",
"age": 25
}
]
}
}
```