Answer architecture round 2: split reading_cost's main, reset the trend when the reading-cost item ships, order figures by finish time, share the archive's stamp format

This commit is contained in:
2026-10-08 16:31:37 +02:00
parent 471350d388
commit aa062da0bd
8 changed files with 82 additions and 38 deletions
+2 -3
View File
@@ -5,7 +5,6 @@ import re
import shlex
import typing
HEREDOC = {"<<", "<<-"}
NOT_A_PATH = re.compile(r"[*?\[\]{}$\\'\",=()<>|;&]|://|^\d+$")
# Their first operand is a pattern or a program, unless -e or -f gives it.
PATTERN_FIRST = {"awk", "egrep", "grep", "rg", "sed"}
@@ -45,8 +44,8 @@ def shell_lines(command: str) -> typing.Iterator[list[str]]:
tokens = list(lexer)
except ValueError:
continue
marker = next((tokens[index + 1] for index, token in enumerate(tokens[:-1]) if token in HEREDOC), None)
ends = marker
# The lexer splits <<-EOF into << and -EOF.
ends = next((tokens[index + 1].removeprefix("-") for index, token in enumerate(tokens[:-1]) if token == "<<"), None)
yield tokens