Skip to content

Commit 986c926

Browse files
author
Shengjie Xu
committed
Minor fix
1 parent e4c738d commit 986c926

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/preppipe/frontend/commandsyntaxparser.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,11 @@ def check_is_command_start(b : Block, ctx: Context) -> tuple[str, list[AssetData
327327
else:
328328
raise PPNotImplementedError('TODO support other possible element types in IMElementOp')
329329
if first_op is None:
330-
# 这是开头
331-
if command_str.startswith(_command_start_text):
330+
# 这应该是开头,不过如果全是空格的话就等下一个
331+
command_head = command_str.lstrip()
332+
if len(command_head) == 0:
333+
continue
334+
if command_head.startswith(_command_start_text):
332335
first_op = op
333336
else:
334337
# 该段不以 _command_start_text 所注字符开头,不是命令

0 commit comments

Comments
 (0)