Commit Graph

4 Commits

Author SHA1 Message Date
abdussamedulutas 913b42026c test(opt): #104/#105 beyaz-kutu IR testleri — folding ve DCE doğru katmanda
- ir.hpp: --optimized bayrağı ile OptimizationManager entegrasyonu
- ir_generator.cpp: hasDirectValue/directIntValue okunuyor (katlanmış literal IR'da 0 veriyordu)
- run_golden.cmake: OPTIMIZED=1 parametresi ile --optimized desteği
- CMakeLists.txt: *.ir_opt.expected → saqut ir --optimized otomatik keşif
- opt/folding.ir_opt.expected: 2+3*4 → LOAD_CONST 14 (katlama kanıtı)
- opt/dce.ir_opt.expected: LOAD_CONST 99 + CALLHOST print silindi (DCE kanıtı)
- Yanıltıcı run-output testleri (folding.expected, dce.expected) kaldırıldı
2026-06-18 22:47:31 +03:00
abdussamedulutas ac96ad810c test: golden testler — operatör önceliği, döngüler, folding, DCE
closes #99, #100, #104, #105

- arithmetic/precedence: Pratt öncelik + sol-birliktelik + modulo
- loops/basic: while/do-while/for üçü de 0,1,2 üretiyor
- loops/do_while_once: koşul baştan yanlış, gövde yine de bir kez çalışıyor
- opt/folding: sabit katlama çıktısı (14,3,1,0,1,0,0)
- opt/dce: ölü return sonrası kod programı etkilemiyor (10,0,0)
9/9 ctest geçti
2026-06-18 22:33:19 +03:00
abdussamedulutas 85d955ec62 test: golden-test koşucusu + Value audit + saqut ir pipeline fix
closes #113, #114, #75

- cmake/run_golden.cmake: BINARY/SOURCE/EXPECTED ile çalışan karşılaştırma betiği
- CMakeLists.txt: enable_testing(), golden test otomatik keşif (CONFIGURE_DEPENDS),
  unit_tests (tests/run.sh) ctest entegrasyonu
- tests/golden/: fibonacci, string, arithmetic — 4/4 yeşil (negatif doğrulama da geçti)
- value.hpp: stale yorum temizlendi, toString() eklendi, switch exhaustive hale getirildi
- ir.hpp: TypeChecker + StructuralValidator eklendi — run pipeline ile artık eşit
2026-06-18 22:31:26 +03:00
abdussamedulutas 1c5178168e feat(faz0): tip sistemi + tanılama motoru (Type + DiagnosticEngine)
Faz 0 (#69) — frontend'in iki temel veri yapısı:

- src/core/type.hpp: Type (Primitive/Array/Struct/Function/Error),
  equals() (katı yapısal, gizli dönüşüm yok — ADR-010), toString(),
  toJson() (cam ilkesi), factory'ler ve fromName() yardımcısı.
- src/diagnostic/diagnostic.hpp: DiagLevel, Diagnostic (veri birincil),
  hata kataloğu (E001-E010, W001-W003) + jsonEscape + makeDiagnostic.
- src/diagnostic/diagnostic_engine.hpp: toplar (ilk hatada durmaz,
  ADR-013), printAll() (insan-okur, sıralı) + toJson() (makine-okur).
- tests/: çerçevesiz birim testleri + run.sh.

Header-only (ADR-003). -Wall -Wextra temiz. Henüz pipeline'a bağlı
değil; Faz 2/3 (sembol tablosu, tip denetleyici) bunları tüketecek.
2026-06-16 00:31:44 +03:00