From 7249ca3a6fdf51f6b7ea66ac6854edd5e02ae5ec Mon Sep 17 00:00:00 2001 From: tanaka takashi Date: Wed, 15 Jul 2026 20:00:24 +0900 Subject: feat: MMLパーサーと意味解析を厳格化 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ppmckの終端分岐付きリピートとL制御トラックを実装 - case、構文構造、音長、エフェクト値域の検証を強化 - Pyxel拡張コマンドのarityと参照検証を追加 - リピート展開上限と構文・意味エラー時の合成停止を追加 - BNF、設計書、適合監査、回帰テストを更新 --- src/mml_composemusic_mcp/parser_base.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/mml_composemusic_mcp/parser_base.py') diff --git a/src/mml_composemusic_mcp/parser_base.py b/src/mml_composemusic_mcp/parser_base.py index 506a33e..2625c5d 100644 --- a/src/mml_composemusic_mcp/parser_base.py +++ b/src/mml_composemusic_mcp/parser_base.py @@ -33,6 +33,11 @@ class ParserContext: def expect(self, *types: TokenType) -> Token | None: return self.match(*types) + def synchronize(self, *types: TokenType) -> None: + """Advance to a recovery token without ever consuming past EOF.""" + while self.peek().type not in (*types, TokenType.EOF): + self.advance() + def add_error( self, code: ErrorCode, -- cgit v1.2.3