abdussamedulutas
e84828b631
feat(faz3): semantik analiz — tip denetimi + yapısal doğrulama ( #72 )
...
- src/semantic/type_checker: her ExpressionNode'a resolvedType atar
* literal bağlama-göre tiplenir (float x = 1 → uyarısız)
* değişken→değişken genişletme → W004
* daraltma / farklı tip → E003
* fonksiyon çağrısı argüman sayısı/tipi → E008
* return tipi uyumsuzluğu → E003 (checkAssign üzerinden)
- src/semantic/structural_validator: kontrol akışı kuralları
* break/continue döngü dışı → E004
* return fonksiyon dışı → E005
- W004 diagnostic kataloğa eklendi
- saqut check komutu: tokenize→parse→collect→typecheck→validate
- examples/semantic/: widening, narrowing, bad_return, break_outside, bad_args
- MISSION-FAZ3.md eklendi
Doğrulama:
fibonacci.sqt → 0 hata 0 uyarı ✓
widening.sqt → W004 ✓
narrowing.sqt → E003 ✓
break_outside.sqt → E004 ✓
bad_args.sqt → E008 ✓
tests/run.sh → TUM TESTLER GECTI ✓
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 17:20:06 +03:00
abdussamedulutas
b071dab54c
feat(symbols): --compact bayrağı + referenceCount alanı
...
- CliArgs'e compact bool eklendi; --compact ile boşluksuz JSON çıktısı
- symbols çıktısında her sembol için referenceCount (references.size()) alanı eklendi
- fibonacci.sqt onarıldı: araç hatası sonucu silinen '{' geri konuldu
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 16:44:03 +03:00
abdussamedulutas
dc41a5df59
refactor: nlohmann/json entegrasyonu — string birleştirme yerine nesne API
...
- src/vendor/nlohmann/json.hpp eklendi (single-header, MIT)
- SourceLocation → toJsonObj() + toJson() (nlohmann)
- Type → toJsonObj() + toJson() (nlohmann, özyinelemeli)
- Diagnostic → toJsonObj() + toJson() (nlohmann)
- DiagnosticEngine→ toJsonObj() + toJson() (nlohmann)
- symbols.hpp → tamamen nlohmann ile yeniden yazıldı
Tüm toJson() imzaları std::string döndürmeye devam eder;
AST JsonObject builder'ı dokunulmadı (ayrı katman).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 16:21:58 +03:00
abdussamedulutas
e223995f20
feat(symbols): JSON çıktı + syntax hata toleransı
...
- symbols komutu artık JSON üretiyor: file, symbols[], diagnostics
Her sembol: name, kind, type, typeDetail, definition (file+satır+sütun),
references[], isBuiltin — LSP tüketimine hazır format
- parser: parseProgram() ilerleme olmayana token atla (guard ekle)
Bozuk top-level syntax (ör: `}`, eksik parametre listesi) artık
ayrıştırmayı durdurmak yerine sonraki geçerli bildirimi bulmaya devam eder
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 16:11:34 +03:00
abdussamedulutas
ba08bf4511
feat(faz2): sembol tablosu — isim çözümleme + scope + referans toplama ( #71 )
...
- parser: parseFunctionDecl() parametreleri artık AST'ye alıyor
(FunctionDeclNode::params alanı eklendi; declarations.hpp/cpp güncellendi)
- parser: parseDeclaration() kullanıcı-tanımlı tip (struct alanı) desteği
- ast_json: addArray() m_hasArrayItem sıfırlama hatası düzeltildi
(birden fazla dizi alanı içeren düğümlerde bozuk JSON üretimi giderildi)
- src/symbol/: Symbol, Scope, SymbolTable, SymbolCollector eklendi
* İki geçiş: pass1 global hoist, pass2 gövde + declare-before-use
* E001 tanımsız isim, E002 çift tanım, E010 döngüsel struct
* print builtin tohumlama (TODO: #89 katalog)
- cli/symbols: yeni SymbolTable/Collector kullanıyor; tip + refs çıktısı
- examples/symbols/: dup.sqt, undef.sqt, cyclic.sqt test fixture'ları
Doğrulama:
build/saqut symbols file:examples/fibonacci.sqt → 0 hata, 10 sembol
examples/symbols/dup.sqt → E002
examples/symbols/undef.sqt → E001
examples/symbols/cyclic.sqt → E010
tests/run.sh → TUM TESTLER GECTI
AST JSON → geçerli
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 15:43:26 +03:00
abdussamedulutas
7c5a86c39b
fix: kaynak dosya yolu propagasyonu ve AST JSON girinti hataları
...
- Tokenizer::scan artik filePath parametresi alip Lexer'a iletiyor;
SourceLocation.file artik bos degil (Asama 0 tamamlandi).
- JsonObject::add icin const char* overload eklendi (kind: true bug'i).
- JsonObject acilis suslu parantezi girintisiz yaziliyor, addArray ilk
eleman oncesi bos satir birakmiyor; LiteralNode/IdentifierNode toJson
ayni sekilde duzeltildi.
- analysisToJson girinti seviyeleri "analysis" objesine gore duzeltildi.
2026-06-14 15:57:54 +03:00
abdussamedulutas
93cbc7db3a
Gemini
2026-05-27 10:29:30 +03:00