This commit is contained in:
2026-06-16 01:27:54 +09:00
parent 5d6a03b74f
commit 4e82f47f90
31 changed files with 141 additions and 112 deletions
+18 -6
View File
@@ -3,11 +3,23 @@
この章では、表層構文の方針をまとめる。
厳密な EBNF は未確定であり、今後このファイルに詳細化する。
## 言語名と拡張子
プロジェクト名は **Decodal** とする。
正式な説明名は **Deferred Constraint Data Language**、略称は **DCDL** とする。
ファイル拡張子は `.dcdl` とする。
```text
config.dcdl
schema.dcdl
service.dcdl
```
## コメント
コメントは `#` から行末までとする。
```n
```dcdl
# comment
host = "127.0.0.1"; # trailing comment
```
@@ -17,7 +29,7 @@ host = "127.0.0.1"; # trailing comment
オブジェクトフィールド、let 束縛、match 分岐はセミコロンで区切る。
末尾セミコロンは許可する。
```n
```dcdl
{
host = "127.0.0.1";
port = 8000;
@@ -29,7 +41,7 @@ host = "127.0.0.1"; # trailing comment
識別子の厳密な字句規則は未確定である。
慣習としては `lower_snake``lowerCamel``UpperCamel` を使える想定とする。
```n
```dcdl
my_config
mkConfig
IPv4Address
@@ -39,14 +51,14 @@ IPv4Address
ドットによるフィールド参照を許可する。
```n
```dcdl
config.host
config.feature_hoge.enable
```
オブジェクト内では、ドットパスによるフィールド定義も許可する。
```n
```dcdl
{
feature_hoge.enable = false;
}
@@ -54,7 +66,7 @@ config.feature_hoge.enable
これは以下と同じ構造を表す。
```n
```dcdl
{
feature_hoge = {
enable = false;