Prettyfy definitions in Checker::run()
This commit is contained in:
parent
c1e1962cfd
commit
1d091c58d0
1 changed files with 11 additions and 7 deletions
|
@ -713,13 +713,17 @@ void Checker::run(SourceFile* SF) {
|
|||
TypeEnv Env;
|
||||
auto A = createTVar();
|
||||
auto B = createTVar();
|
||||
Env.add("Int", getIntType(), SymbolKind::Type);
|
||||
Env.add("Bool", getBoolType(), SymbolKind::Type);
|
||||
Env.add("String", getStringType(), SymbolKind::Type);
|
||||
Env.add("True", getBoolType(), SymbolKind::Var);
|
||||
Env.add("False", getBoolType(), SymbolKind::Var);
|
||||
Env.add("+", new TFun(getIntType(), new TFun(getIntType(), getIntType())), SymbolKind::Var);
|
||||
Env.add("-", new TFun(getIntType(), new TFun(getIntType(), getIntType())), SymbolKind::Var);
|
||||
auto Bool = getBoolType();
|
||||
auto Int = getIntType();
|
||||
auto String = getStringType();
|
||||
Env.add("Int", Int, SymbolKind::Type);
|
||||
Env.add("Bool", Bool, SymbolKind::Type);
|
||||
Env.add("String", String, SymbolKind::Type);
|
||||
Env.add("True", Bool, SymbolKind::Var);
|
||||
Env.add("False", Bool, SymbolKind::Var);
|
||||
Env.add("not", new TFun(Bool, Bool), SymbolKind::Var);
|
||||
Env.add("+", new TFun(Int, new TFun(Int, Int)), SymbolKind::Var);
|
||||
Env.add("-", new TFun(Int, new TFun(Int, Int)), SymbolKind::Var);
|
||||
Env.add("$", new TypeScheme({ A, B }, new TFun(new TFun(A, B), new TFun(A, B))), SymbolKind::Var);
|
||||
auto Out = inferSourceFile(Env, SF);
|
||||
solve(Out);
|
||||
|
|
Loading…
Reference in a new issue