tomoyanonymous on new-ast
fixed tuple parser fixed recursive call allows empty argument and 13 more (compare)
tomoyanonymous on new-ast
fixed foldl logic fixed X expression codes fixed ast_lowering codes and 15 more (compare)
tomoyanonymous on new-ast
fixed compile error on tests (compare)
tomoyanonymous on new-ast
suppressed errors (compare)
tomoyanonymous on new-ast
[skip ci]applied new type defin… (compare)
tomoyanonymous on new-ast
uncommented assertion made ffi to new type implementa… add ffi to type inference and 2 more (compare)
tomoyanonymous on new-ast
[skip ci] imple new type inferer (compare)
tomoyanonymous on new-ast
[skip ci fixed bug] [skip ci]typeinferer unifier im… (compare)
tomoyanonymous on new-ast
wip new ast parsing [skip ci] succeeded to compile … (compare)
tomoyanonymous on new-ast
impl ast lowering (compare)
たとえば
+++ b/src/compiler/mimium.yy
@@ -306,9 +306,9 @@ typeargs: typeargs ',' types { $1.emplace_back(std::move($3));
$$ = std::move($1); }
| types { $$ = std::vector<types::Value>{$1};}
-structtype: LBRACE strutypeargs RBRACE { $$ = types::Struct{std::move($2)}; }
+structtype: LBRACE opt_nl strutypeargs opt_nl RBRACE { $$ = types::Struct{std::move($2)}; }
-strutypeargs : strutypeargs ',' strutypearg { $1.emplace_back(std::move($3));$$ = std::move($1); }
+strutypeargs : strutypeargs ',' opt_nl strutypearg { $1.emplace_back(std::move($3));$$ = std::move($1); }
| strutypearg {$$ = std::vector<types::Struct::Keytype>{$1}; }
strutypearg : SYMBOL TYPE_DELIM types { $$ = types::Struct::Keytype{std::move($1),std::move($3)}; }
みたいな変更するとよい感じなんでしょうか。いま屋外でLLVMがなくビルドして試せないのでイメージの相談です。
そもそも実はstructの初期化は
hoge = {field1 = 100,field2 = 200}
見たくフィールド名を明示する方が型判定の処理がしやすいので仕様変えちゃおっかなあと迷ってるとこだったりします