saqut
786812c717
feat(string+error+null): ADR-024/025/021 uygulama — string concat, try/catch/throw, nullable akış-analizi
...
## String cilası (ADR-024)
- STRING_CONCAT opcode: s1 + s2 ve s1 += s2 → yeni string üretir
- Tip denetleyicide string + string → string; içerik == zaten vardı
- Golden: tests/golden/string/concat.sqt
## Hata yönetimi (ADR-025, #57 )
- AST: TryStatementNode, ThrowStatementNode
- Parser: try { } catch (Error e) { }, throw <ifade>;
- IR: ENTER_TRY / LEAVE_TRY / THROW opcode'ları + backpatch
- VM: TryFrame yığını + pendingThrow_ unwind; runtime hatalar (DIV/0, OOB)
artık yakalanabilir Error nesnesi olarak yükseltiliyor
- Builtin: Error{line,col,message,trace,code} sembol tablosuna kayıtlı
- Golden: tests/golden/error/basic_catch.sqt, throw_and_nested.sqt
## Null akış-analizi (ADR-021 — REVİZE, a!/??/?. yasak)
- Type: nullable bool alanı; asNullable/asNonNull/equalsBase/isNullLiteral
- fromName("int?") → nullable int; toString() → "int?"
- Parser: T? değişken/parametre/dönüş tipi; int? f() dispatch bug'ı düzeltildi
- IR: LOAD_NULL opcode; null literal → Value::null()
- Tip denetleyici:
- checkAssign: T? ← null OK; T ← T? E003; T? ← T OK (widening)
- Nullable operand aritmetikte/karşılaştırmada E003
- MemberAccess: nullable nesnede doğrudan erişim E003
- Nested: if (a != null) → then'de non-null
- Guard: if (a == null) return; → sonrasında non-null
- &&: sol null-check → sağ tarafta non-null
- Golden: tests/golden/null/{narrowing,and_narrowing,nullable_assign_error,nullable_operand_error}
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YAu3MGu3sWAUvTu7N9agPk
2026-06-20 21:34:25 +03:00
saqut
a4fb3cfc4f
fix(tc): string sıralama operatörleri derleme zamanında bloklandı (B5)
...
Sorun: TypeChecker < > <= >= için tip kontrolü yapmıyordu; string
operandlarda VM sessizce intValue=0 karşılaştırıyordu.
Düzeltme: karşılaştırma bloğu ikiye ayrıldı:
== / != → string dahil herhangi tip (değişmedi)
< > <= >= → isNumeric() kontrolü; string veya diğer sayısal-olmayan
tipler E003 üretir, VM'e hiç ulaşmaz
Aritmetik (+ - * / %) zaten sayısal-olmayan tipler için E003 üretiyordu;
doğrulandı, değiştirilmedi.
Altyapı: cmake/run_golden_error.cmake + CMakeLists.txt'e .compile_error
desteği — derleme hatası bekleyen negatif golden testler için.
Testler (19/19 yeşil):
- string/ordering_error: string < → E003 (negatif test)
- string/equality: string == / != çalışmaya devam ediyor (regresyon)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-19 16:26:20 +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