Skip to content

feat: Parser e Type Checker para test framework (Projeto 8, Partes 1 e 2)#13

Open
agaf2 wants to merge 2 commits into
rbonifacio:mainfrom
agaf2:feat/project8-parser-typechecker
Open

feat: Parser e Type Checker para test framework (Projeto 8, Partes 1 e 2)#13
agaf2 wants to merge 2 commits into
rbonifacio:mainfrom
agaf2:feat/project8-parser-typechecker

Conversation

@agaf2

@agaf2 agaf2 commented Jun 15, 2026

Copy link
Copy Markdown

Group

Alberto Guevara de Araujo Franca
Davi Gonzaga Guerreiro Barboza
Fábio Pereira de Miranda
Felipe Torres de Macedo

Summary

  • Parses test "name" { stmts } as new top-level declaration alongside function declarations
  • Parses assert expr; as new statement type
  • Type checker validates assert requires a bool expression
  • Test bodies are type-checked like void function bodies (no return type)
  • Detects duplicate test names at compile time
  • Programs with only test blocks (no main) pass type checking

Test plan

  • New type checker tests: assert with bool, assert with non-bool (error), test block OK, test block without main, duplicate test name detection, bad assert type in test block
  • All 135 existing tests pass (cargo test)
  • Test fixture test_framework.minic parses and type-checks correctly

agaf2 and others added 2 commits April 20, 2026 15:50
…s 1 and 2)

- Parse `test "name" { stmts }` as top-level declaration
- Parse `assert expr;` as new statement
- Type check assert requires bool expression
- Type check test bodies like void function bodies
- Detect duplicate test names
- Add stub for assert in interpreter (runtime support pending Part 3)

Co-Authored-By: Alberto Guevara <agaf2@cin.ufpe.br>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants