Implemented register calls

This commit is contained in:
2025-03-02 17:53:18 +01:00
parent d7f30d8319
commit c3054369e3
16 changed files with 133 additions and 43 deletions

View File

@ -0,0 +1,5 @@
main() {}
f(x unknown) -> int {
return x
}

View File

@ -0,0 +1,5 @@
main() {}
f(x int) -> unknown {
return x
}

View File

@ -0,0 +1,3 @@
main() {}
f(x int) {}

View File

@ -58,10 +58,13 @@ var errs = []struct {
{"UnknownIdentifier2.q", &errors.UnknownIdentifier{Name: "x"}},
{"UnknownIdentifier3.q", &errors.UnknownIdentifier{Name: "x"}},
{"UnknownPackage.q", &errors.UnknownPackage{Name: "sys"}},
{"UnknownType.q", &errors.UnknownType{Name: "unknown"}},
{"UnknownType2.q", &errors.UnknownType{Name: "unknown"}},
{"UnknownStructField.q", &errors.UnknownStructField{StructName: "A", FieldName: "x"}},
{"UntypedExpression.q", errors.UntypedExpression},
{"UnusedImport.q", &errors.UnusedImport{Package: "sys"}},
{"UnusedVariable.q", &errors.UnusedVariable{Name: "x"}},
{"UnusedVariable2.q", &errors.UnusedVariable{Name: "x"}},
{"VariableAlreadyExists.q", &errors.VariableAlreadyExists{Name: "x"}},
}

View File

@ -0,0 +1,6 @@
import core
main() {
exit := core.exit
exit()
}

View File

@ -68,6 +68,7 @@ var programs = []struct {
{"struct", 0},
{"len", 0},
{"cast", 0},
{"function-pointer", 0},
}
func TestPrograms(t *testing.T) {