221V 1 месяц назад
Родитель
Сommit
27e0eea819
4 измененных файлов с 39 добавлено и 17 удалено
  1. 4 0
      dopp.toml
  2. 15 13
      dub.json
  3. 7 0
      dub.selections.json
  4. 13 4
      source/app.d

+ 4 - 0
dopp.toml

@@ -0,0 +1,4 @@
+
+indent_type = 0
+indent_matter = 4
+indent_out = 2

+ 15 - 13
dub.json

@@ -1,15 +1,17 @@
 {
-	"authors": [
-		"221V"
-	],
-	"copyright": "Copyright © 2025, 221V",
-	"description": "dopp = DEF compiler / D preprocessor",
-	"license": "MIT",
-	"name": "dopp",
-	"mainSourceFile": "source/app.d",
-	"sourceFiles": ["source/app.d"],
-	"targetName": "dopp",
-	"targetType": "executable",
-	"dflags": ["-w", "-O", "-static"],
-	"dependencies": {}
+  "authors": [
+    "221V"
+  ],
+  "copyright": "Copyright © 2025, 221V",
+  "description": "dopp = DEF compiler / D preprocessor",
+  "license": "MIT",
+  "name": "dopp",
+  "mainSourceFile": "source/app.d",
+  "sourceFiles": ["source/app.d"],
+  "targetName": "dopp",
+  "targetType": "executable",
+  "dflags": ["-w", "-O", "-static"],
+  "dependencies": {
+    "toml": "~>2.0.1"
+  }
 }

+ 7 - 0
dub.selections.json

@@ -0,0 +1,7 @@
+{
+	"fileVersion": 1,
+	"versions": {
+		"toml": "2.0.1",
+		"unit-threaded": "2.0.5"
+	}
+}

+ 13 - 4
source/app.d

@@ -1,6 +1,15 @@
-import std.stdio;
 
-void main()
-{
-	writeln("Edit source/app.d to start your project.");
+import toml;
+import std.stdio : writeln;
+import std.file : read;
+
+
+TOMLDocument toml_s;
+
+
+void main(){
+  toml_s = parseTOML(cast(string)read("dopp.toml"));
+  writeln("indent_matter: ", toml_s["indent_matter"]); // 4
 }
+
+