|
@@ -13,8 +13,8 @@ public{
|
|
|
import std.sumtype : SumType;
|
|
|
}
|
|
|
|
|
|
-//import dopp_lexer : tokenize, isKeyword;
|
|
|
-//import dopp_parser : parse;
|
|
|
+import dopp_lexer : tokenize, isKeyword;
|
|
|
+import dopp_parser : parse;
|
|
|
|
|
|
|
|
|
TOMLDocument toml_s;
|
|
@@ -175,13 +175,13 @@ int main(string[] argv){
|
|
|
|
|
|
|
|
|
auto indent_type = get_config_value(toml_s, "indent_type");
|
|
|
- writeln("config: indent_type = ", indent_type); // 0
|
|
|
+ //writeln("config: indent_type = ", indent_type); // 0 // todo add config key-value "no_warn" = false | true for silence
|
|
|
|
|
|
auto indent_matter = get_config_value(toml_s, "indent_matter");
|
|
|
- writeln("config: indent_matter = ", indent_matter); // 4
|
|
|
+ //writeln("config: indent_matter = ", indent_matter); // 4
|
|
|
|
|
|
auto indent_out = get_config_value(toml_s, "indent_out");
|
|
|
- writeln("config: indent_out = ", indent_out); // 2
|
|
|
+ //writeln("config: indent_out = ", indent_out); // 2
|
|
|
|
|
|
|
|
|
/*
|
|
@@ -194,19 +194,21 @@ int main(string[] argv){
|
|
|
*/
|
|
|
|
|
|
string[] argv1 = argv[1 .. $]; // argv[0] always = program name ( ./dopp in my case in linux )
|
|
|
- bool valid1 = is_valid_argv(argv1);
|
|
|
- writeln("valid1 = ", valid1);
|
|
|
+ bool valid_argv = is_valid_argv(argv1);
|
|
|
+ // writeln("valid_argv = ", valid_argv); // todo add config key-value "no_warn" = false | true for silence
|
|
|
|
|
|
- if(!valid1){
|
|
|
+ if(!valid_argv){
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
- //string source = `if (x > 0) { writeln("Positive"); }`;
|
|
|
- //auto tokens = tokenize(source);
|
|
|
- //writeln(tokens);
|
|
|
- //parse(tokens);
|
|
|
+ string source = `if (x > 0) { writeln("Positive"); }`;
|
|
|
+ auto tokens = tokenize(source);
|
|
|
+ writeln(tokens);
|
|
|
+ parse(tokens);
|
|
|
+
|
|
|
+
|
|
|
|
|
|
return 1;
|
|
|
}
|