shenjackyuanjie
369b675963
modified: Difficult_Rocket/api/Exp/command.py modified: Difficult_Rocket/client/__init__.py modified: Difficult_Rocket/client/fps/fps_log.py modified: Difficult_Rocket/command/api.py modified: Difficult_Rocket/command/line.py modified: Difficult_Rocket/utils/__init__.py modified: Difficult_Rocket/utils/new_thread.py modified: Difficult_Rocket/utils/tools.py modified: Difficult_Rocket/utils/translate.py new file: try/mcdr/command_tree.py
55 lines
1.2 KiB
Python
55 lines
1.2 KiB
Python
# -------------------------------
|
|
# Difficult Rocket
|
|
# Copyright © 2021-2022 by shenjackyuanjie
|
|
# All rights reserved
|
|
# -------------------------------
|
|
|
|
"""
|
|
writen by shenjackyuanjie
|
|
mail: 3695888@qq.com
|
|
github: @shenjackyuanjie
|
|
gitee: @shenjackyuanjie
|
|
"""
|
|
|
|
from . import Error
|
|
|
|
|
|
class CommandError(Error):
|
|
"""命令解析相关 error"""
|
|
|
|
|
|
class CommandParseError(CommandError):
|
|
"""命令解析时出现错误"""
|
|
|
|
|
|
# QMark -> Quotation marks
|
|
# Pos -> Position
|
|
|
|
class CommandQMarkPosError(CommandParseError):
|
|
"""命令中,引号位置不正确
|
|
例如: /command "aabcc "awdawd"""
|
|
|
|
|
|
class CommandQMarkMissing(CommandParseError):
|
|
"""命令中引号缺失
|
|
例如: /command "aawwdawda awdaw """
|
|
|
|
|
|
class CommandQMarkConflict(CommandParseError):
|
|
"""命令中引号位置冲突
|
|
例如: /command "aaaa "aaaa aaaa"""
|
|
first_qmark_pos = None
|
|
conflict_qmark_pos = None
|
|
|
|
|
|
class CommandQMarkPreMissing(CommandQMarkMissing):
|
|
"""命令中 前面的引号缺失
|
|
例如: /command aaaa" aaaaaa"""
|
|
suf_qmark_pos = None
|
|
|
|
|
|
class CommandQMarkSufMissing(CommandQMarkMissing):
|
|
"""命令中 后面的引号缺失(引号未闭合)
|
|
例如: /command "aaaawaa some command"""
|
|
pre_qmark_pos = None
|