Commit Graph

11 Commits

Author SHA1 Message Date
5cad0ab20c 🔧 Fix peek expression terminator issues and add ternary operator support
- Fix LLVM IR terminator missing in peek expression entry blocks
- Add proper jump instructions between peek blocks
- Implement ternary operator (? :) as syntactic sugar for peek
- Update Python LLVM externcall handling for improved compatibility
- Add comprehensive test cases for peek and ternary expressions
- Update language guide with ternary operator documentation

ChatGPTが頑張って修正してくれたにゃ!🐱

Co-Authored-By: ChatGPT <noreply@openai.com>
2025-09-14 20:30:38 +09:00
3ba96d9a03 🚀 feat: Multiple improvements for Nyash parser and LLVM backend
Parser improvements:
- Added expression statement fallback in parse_statement() for flexible syntax
- Fixed ternary operator to use PeekExpr instead of If AST (better lowering)
- Added peek_token() check to avoid ?/?: operator conflicts

LLVM Python improvements:
- Added optional ESC_JSON_FIX environment flag for string concatenation
- Improved PHI generation with better default handling
- Enhanced substring tracking for esc_json pattern

Documentation updates:
- Updated language guide with peek expression examples
- Added box theory diagrams to Phase 15 planning
- Clarified peek vs when syntax differences

These changes enable cleaner parser implementation for self-hosting,
especially for handling digit conversion with peek expressions instead
of 19-line if-else chains.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-14 19:16:32 +09:00
17225c29f7 tests: add parser/vm bitops tests; docs: update cheatsheet and language guide for bitwise ops and shift; note Arrow(>>) removal
- Add src/tests/parser_bitops_test.rs and vm_bitops_test.rs
- Update tokenizer unit test to expect SHIFT_RIGHT
- Update quick-reference and language guide to document &,|,^,<<,>> and Arrow deprecation

Known: one unrelated test failing (consolebox println TLV vs typebox) pre-existing.
2025-09-08 04:04:19 +09:00
07f270b966 aot: enable plugin invokes in ObjectBuilder (tagged by-id), add generic NewBox birth via nyash.instance.birth_name_u64x2; egui(plugin): cross-platform run + debug logs; docs: WSL Wayland→X11 troubleshooting and one‑shot scripts; CURRENT_TASK + READMEs updated (JIT runtime sealed). 2025-09-06 16:18:46 +09:00
fff9749f47 📚 Reorganize CLAUDE.md: slim down from 916 to 395 lines with proper doc links
- Keep essential information within 500 lines (now 395 lines)
- Maintain important syntax examples and development principles
- Move detailed information to appropriate docs files:
  - Development practices → docs/guides/development-practices.md
  - Testing guide → docs/guides/testing-guide.md
  - Claude issues → docs/tools/claude-issues.md
- Add proper links to all referenced documentation
- Balance between minimal entry point and practical usability
2025-08-31 06:22:48 +09:00
cdb75dfac1 docs: 包括的なビルドガイドを追加
- docs/guides/build/README.md - すべてのビルドパターンを網羅
- docs/guides/build/cross-platform.md - クロスプラットフォーム開発ガイド
- docs/guides/build/windows-distribution.md - Windows配布版作成の詳細手順
- docs/guides/build/aot-compilation.md - AOTネイティブコンパイルガイド
- CLAUDE.mdにビルドガイドへのリンクを追加
- cargo-xwinでのWindows向けビルド方法を文書化
- プラグインの自動拡張子変換機能(ChatGPT5実装)を説明
2025-08-29 23:38:59 +09:00
63749b683e feat: Add VM statistics and fix compilation errors for plugin tests
- Add VM instruction statistics (--vm-stats, --vm-stats-json)
- Fix missing fields in ast.rs test code (public_fields, private_fields)
- Add CliConfig fields for VM statistics
- Enable TLV debug logging in plugin_loader_v2
- Successfully test FileBox handle passing and HTTP plugin creation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-23 04:51:24 +09:00
cc2a820af7 feat(plugin): Fix plugin BoxRef return and Box argument support
- Fixed deadlock in FileBox plugin copyFrom implementation (single lock)
- Added TLV Handle (tag=8) parsing in calls.rs for returned BoxRefs
- Improved plugin loader with config path consistency and detailed logging
- Fixed loader routing for proper Handle type_id/fini_method_id resolution
- Added detailed logging for TLV encoding/decoding in plugin_loader_v2

Test docs/examples/plugin_boxref_return.nyash now works correctly:
- cloneSelf() returns FileBox Handle properly
- copyFrom(Box) accepts plugin Box arguments
- Both FileBox instances close and fini correctly

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-21 00:41:26 +09:00
621bf7cc3d docs: reorganize into 説明書/予定/archive; update docs/README.md and CLAUDE.md; move root .nyash to local_tests; consolidate native-plan notes into README + archive 2025-08-13 18:54:02 +09:00
7941c4ed6a docs(guides): add Phase 6 issue draft (Box ops minimal) 2025-08-13 18:53:59 +09:00
4c7f000cae Complete Phase 0: Clean duplicate targets and add build documentation
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-13 05:10:42 +00:00