Skip to content

Commit

Permalink
Minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Shengjie Xu committed Jul 25, 2024
1 parent e4c738d commit 986c926
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/preppipe/frontend/commandsyntaxparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,11 @@ def check_is_command_start(b : Block, ctx: Context) -> tuple[str, list[AssetData
else:
raise PPNotImplementedError('TODO support other possible element types in IMElementOp')
if first_op is None:
# 这是开头
if command_str.startswith(_command_start_text):
# 这应该是开头,不过如果全是空格的话就等下一个
command_head = command_str.lstrip()
if len(command_head) == 0:
continue
if command_head.startswith(_command_start_text):
first_op = op
else:
# 该段不以 _command_start_text 所注字符开头,不是命令
Expand Down

0 comments on commit 986c926

Please sign in to comment.