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:
+2
-3
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user