TDA283-compiler-construction / project

Material for TDA283 / DIT300 Compiler Construction
11 stars 27 forks source link

Add new tests #22

Closed Voxed closed 2 years ago

Voxed commented 3 years ago

Some weird test cases which would've initially failed in my compiler.

Assignable arguments Self explanatory

Order of classes when declaring same name fields. When ordering classes from derived -> base and derived has a field of the same name as in base. There might be issues if the compiler only checks base fields after the base class has them added.

Cyclic inheritance Self explanatory, the current suite only tests for extending itself.

Non first class functions Functions can't be shadowed and functions can't be assigned.

Parentheses in access operators As the access operators use grammars such as "Exp "." Exp", tests for "a.(fun() + 5)" should be included as to make sure only EApp and EVar are allowed.

-- Petter