From 1a71873e0e1234b365044b2a311de908aa1ef153 Mon Sep 17 00:00:00 2001 From: Moe Charm Date: Sat, 16 Aug 2025 12:26:17 +0900 Subject: [PATCH] refactor(parser): Step 5 - Final cleanup and documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update module documentation to reflect completed refactoring - Remove unused std::collections::HashMap import - Document module structure and 85% code reduction (1530→227 lines) - Clean up temporary files from refactoring process - Build passes successfully with no errors Parser refactoring complete! 🎉 --- src/parser/mod.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/parser/mod.rs b/src/parser/mod.rs index ae261a6b..f932a341 100644 --- a/src/parser/mod.rs +++ b/src/parser/mod.rs @@ -4,11 +4,16 @@ * Python版nyashc_v4.pyのNyashParserをRustで完全再実装 * Token列をAST (Abstract Syntax Tree) に変換 * - * TODO: リファクタリング計画 + * モジュール構造: + * - common.rs: 共通ユーティリティとトレイト (ParserUtils) * - expressions.rs: 式パーサー (parse_expression, parse_or, parse_and等) * - statements.rs: 文パーサー (parse_statement, parse_if, parse_loop等) - * - declarations.rs: 宣言パーサー (parse_box_declaration, parse_function_declaration等) - * - errors.rs: エラー型定義とハンドリング + * - declarations/: Box宣言パーサー (box_definition, static_box, dependency_helpers) + * - items/: トップレベル宣言 (global_vars, functions, static_items) + * + * 2025-08-16: 大規模リファクタリング完了 + * - 1530行 → 227行 (85%削減) + * - 機能ごとにモジュール分離で保守性向上 */ // サブモジュール宣言 @@ -23,7 +28,6 @@ use common::ParserUtils; use crate::tokenizer::{Token, TokenType, TokenizeError}; use crate::ast::{ASTNode, Span}; -use std::collections::HashMap; use thiserror::Error; // ===== 🔥 Debug Macros =====