Skip to content

Commit

Permalink
sistana: header fragment can fetch trigger segment
Browse files Browse the repository at this point in the history
  • Loading branch information
GreyElaina committed Sep 25, 2024
1 parent 8fe75de commit 1d5be5a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/arclet/alconna/sistana/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def loopflow(self, snapshot: AnalyzeSnapshot[T], buffer: Buffer[T]) -> LoopflowD
# 仅当需要解析 fragments 时进行状态流转。
traverse.ref = traverse.ref.option(option.keyword)
track = mix.tracks[option.keyword]
track.emit_header()
track.emit_header(token.val)

if not option.allow_duplicate and option.keyword in traverse.option_traverses:
return LoopflowDescription.option_duplicated_prohibited
Expand Down Expand Up @@ -211,7 +211,7 @@ def loopflow(self, snapshot: AnalyzeSnapshot[T], buffer: Buffer[T]) -> LoopflowD
return LoopflowDescription.unsatisfied_switch_subcommand

elif token.val in context.options:
# 这里仅仅是使 ref 在正确性检查通过后回退到 subcommand 上下文。
# 这里仅仅是使 ref 在正确性检查通过后,结束 option 的捕获并回退到 subcommand 上下文。
previous_option = context.options[pointer_val]
target_option = context.options[token.val]
track = mix.tracks[previous_option.keyword]
Expand Down
4 changes: 2 additions & 2 deletions src/arclet/alconna/sistana/model/mix.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def forward(

return first

def emit_header(self):
def emit_header(self, segment: str):
if self.header is None:
return

Expand All @@ -153,7 +153,7 @@ def rxput(val):

try:
header.receiver.receive(
_reject_rxfetch,
lambda: segment,
rxprev,
rxput,
)
Expand Down

0 comments on commit 1d5be5a

Please sign in to comment.