From 8a1fcf81dbab9e2eff3c4d558c6910bc8208e49e Mon Sep 17 00:00:00 2001 From: tanaka takashi Date: Sun, 12 Jul 2026 16:20:37 +0900 Subject: MML構文解析処理一部修正。ドキュメント最新化 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mml_composemusic_mcp/parser_base.py | 13 +++++++++++++ 1 file changed, 13 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 1cdb40f..506a33e 100644 --- a/src/mml_composemusic_mcp/parser_base.py +++ b/src/mml_composemusic_mcp/parser_base.py @@ -68,6 +68,19 @@ class ParserContext: context=context, ) + def add_missing_number_error( + self, token: Token, command: str, context: str = "" + ) -> None: + self.add_error( + code=ErrorCode.SYNTAX_INVALID_NUMBER, + line=token.line, + column=token.column, + message=f"'{command}' の後に数値が必要です。", + severity="error", + hint=f"例: {command}4 のように数値を続けてください。", + context=context, + ) + class ParserError(Exception): """Raised by parsers to abort a single statement and recover.""" -- cgit v1.2.3