Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OSPP] Alconna V2 - Sistana #91

Merged
merged 130 commits into from
Oct 12, 2024
Merged
Changes from 1 commit
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
4112acc
sistana: migrate from local lab
GreyElaina Sep 20, 2024
9cdfd3b
sistana: new receiver, endpoint determine
GreyElaina Sep 20, 2024
b29f17c
sistana: feat: ConstraintRx
GreyElaina Sep 20, 2024
b2989b1
sistana: fix: push ahead with Value.value
GreyElaina Sep 20, 2024
d814a65
sistana: free required snapshot from track
GreyElaina Sep 20, 2024
03ea5b7
sistana: feat: complete_on_determined
GreyElaina Sep 20, 2024
9df5df7
sistana: feat: support option traverse
GreyElaina Sep 21, 2024
bcdacf3
sistana: fix: apply default with Value.value
GreyElaina Sep 21, 2024
0e61841
sistana: feat: spec
GreyElaina Sep 21, 2024
08dcfb2
sistana: fix: always set value now
GreyElaina Sep 21, 2024
61f3cc3
sistana: remove SubcommandTraverse.satisfied
GreyElaina Sep 21, 2024
1f98b3f
sistana: feat: IndexedOptionTraversesRecord counts by keyword
GreyElaina Sep 21, 2024
ff2d4fb
sistana: feat: Buffer.pushleft
GreyElaina Sep 21, 2024
8b4dedc
sistana: Buffer.pushleft reject empty segment
GreyElaina Sep 21, 2024
c46e2dd
sistana: feat: option traverse works
GreyElaina Sep 21, 2024
1f29371
sistana: analyzer returns description only
GreyElaina Sep 21, 2024
5061710
sistana: some tiny changes
GreyElaina Sep 21, 2024
e93628f
sistana: fix: append -> appendleft
GreyElaina Sep 21, 2024
b88d3d1
sistana: feat: Fragment.{separators, hybrid_separators}
GreyElaina Sep 21, 2024
08907c0
sistana: clean done todo
GreyElaina Sep 21, 2024
d000dc4
sistana: feat: record subcommmand trigger in traverse
GreyElaina Sep 21, 2024
da65981
sistana: feat: Fragment.apply_nepattern(capture_mode: bool)
GreyElaina Sep 21, 2024
98f8413
Merge branch 'ArcletProject:dev' into v2-sistana
GreyElaina Sep 21, 2024
d125b55
legecy: merge arclet.alconna.model pyi
GreyElaina Sep 21, 2024
cc22687
sistana: move type, cast attr to userspace
GreyElaina Sep 21, 2024
db003ea
sistana: respect Fragment.cast
GreyElaina Sep 21, 2024
72abc8e
sistana: complete `__init__` modules
GreyElaina Sep 21, 2024
9fee24e
sistana: new snapshot gen
GreyElaina Sep 21, 2024
a2ced66
sistana: SubcommandPattern.{compacts => compact_keywords}
GreyElaina Sep 21, 2024
d0695eb
sistana: feat: SubcommandPattern.build
GreyElaina Sep 21, 2024
63c4f45
sistana: remove unused util
GreyElaina Sep 22, 2024
fd367fa
chore: reimpl safe_dcls_kw
GreyElaina Sep 22, 2024
d9de915
sistana: mis-operate git
GreyElaina Sep 22, 2024
520f8a7
sistana: capture nepattern with pat.regex_pattern
GreyElaina Sep 22, 2024
8169fb8
sistana: add comments to CLARIFY
GreyElaina Sep 22, 2024
de2187c
sistana: fix {option -> option'}; stop obtain aliases for pointer
GreyElaina Sep 22, 2024
4b04945
sistana: export Value type
GreyElaina Sep 22, 2024
55fed08
fix: ensure prefix: str to satisfy sistana
GreyElaina Sep 22, 2024
4a1469d
sistana: LoopflowDescription.__repr__
GreyElaina Sep 22, 2024
523d782
stargazing: basically works
GreyElaina Sep 22, 2024
6f4f8d1
stargazing: remove unused expression
GreyElaina Sep 22, 2024
4f0fd6f
sistana: remove duplicated util
GreyElaina Sep 22, 2024
aeec7c6
sistana: fix nepattern apply
GreyElaina Sep 22, 2024
08eaa39
sistana: drop getter/putter generator in track
GreyElaina Sep 22, 2024
d1b16a9
sistana: make pyright happy
GreyElaina Sep 22, 2024
18c42fb
sistana-compat: feat: soft_keyword for legecy
GreyElaina Sep 22, 2024
49f23ad
chore: ruff line length = 140
GreyElaina Sep 22, 2024
8477cc4
sistana: fix: import nepattern
GreyElaina Sep 22, 2024
cfb7cab
sistana: pointer role enum
GreyElaina Sep 22, 2024
633f373
sistana: move some continuable description
GreyElaina Sep 22, 2024
52054f2
sistana: remove commented-out Mix.result
GreyElaina Sep 22, 2024
bb6940d
sistana: rename param for Track.fetch
GreyElaina Sep 22, 2024
36a061c
sistana: rename Track.forward({rxget, rxput})
GreyElaina Sep 22, 2024
bce0b33
sistana: fix wrong comment
GreyElaina Sep 22, 2024
851c583
Merge branch 'ArcletProject:dev' into v2-sistana
GreyElaina Sep 22, 2024
0382818
docs: changelog
GreyElaina Sep 22, 2024
79f8304
sistana: use elaina-segment buffer (cython)
GreyElaina Sep 23, 2024
b6906d4
sistana: enable dataclass slots=True or hand-written
GreyElaina Sep 23, 2024
3d93f47
sistana: perf: hand-written init and slots
GreyElaina Sep 23, 2024
e13f5af
chore: remove unused imports
GreyElaina Sep 23, 2024
bd342f0
sistana: merge error catch
GreyElaina Sep 23, 2024
9e3a7eb
sistana: new receiver (fetch, prev, put)
GreyElaina Sep 23, 2024
5981c3e
sistana: fix: access first rune
GreyElaina Sep 23, 2024
d50e872
sistana: cmp pointer type with `is`
GreyElaina Sep 23, 2024
e06b1b2
sistana: rename module {track => mix}
GreyElaina Sep 23, 2024
e275bf9
sistana: feat: option-level receiver & mix support
GreyElaina Sep 23, 2024
f5be429
sistana: fix: net assignes with frag.name
GreyElaina Sep 23, 2024
2f21746
sistana: move/simplify util module
GreyElaina Sep 23, 2024
5c56d71
sistana: remove net
GreyElaina Sep 24, 2024
95ce7e0
sistana: preset accepts Track only
GreyElaina Sep 24, 2024
f30eb6b
sistana: feat: Track.header_fragment, Option.{header_fragment, keep_p…
GreyElaina Sep 24, 2024
ecd3b53
sistana: fix pointer repr
GreyElaina Sep 24, 2024
4d365c6
sistana: ok we have var pos for fragments
GreyElaina Sep 25, 2024
9163388
sistana: re-export from upstream
GreyElaina Sep 25, 2024
4700da0
sistana: apply posvar
GreyElaina Sep 25, 2024
8fe75de
sistana: allow compact aliases
GreyElaina Sep 25, 2024
1d5be5a
sistana: header fragment can fetch trigger segment
GreyElaina Sep 25, 2024
d97a826
sistana: feat: subcommand header fragment
GreyElaina Sep 25, 2024
a0f67a3
sistana: fix: SubcommandPattern.build didn't init empty track for emp…
GreyElaina Sep 25, 2024
b0a0b08
sistana: feat: option header separators
GreyElaina Sep 25, 2024
f67de0b
sistana: add fragments check for header_separators
GreyElaina Sep 25, 2024
8d2eeb6
sistana: always create track for option
GreyElaina Sep 25, 2024
3fbc0f0
sistana: format code
GreyElaina Sep 25, 2024
9fd180b
sistana: fix: check fragments order when add_track
GreyElaina Sep 25, 2024
c792ebd
sistana: remove unused reject helper
GreyElaina Sep 25, 2024
eeec0df
sistana: fix: Pointer should impl eq and hash
GreyElaina Sep 25, 2024
dd9db0c
sistana: feat: export
GreyElaina Sep 25, 2024
1f4acf3
sistana-stargazing: feat: loopflow exit reason to legecy alconna exce…
GreyElaina Sep 25, 2024
3f051c9
sistana: rename LoopflowDescription => LoopflowExitReason
GreyElaina Sep 25, 2024
a5129f8
sistana: oops i typo const
GreyElaina Sep 25, 2024
aaa614c
sistana: feat: emit_header respect allow_deplicate
GreyElaina Sep 25, 2024
a76ec63
sistana: widen prefix logic
GreyElaina Sep 25, 2024
7adbc81
sistana: feat: Pointer.{last_role, last_value}
GreyElaina Sep 25, 2024
82bc474
sistana-stargazing: alconna patch minimal works
GreyElaina Sep 25, 2024
2998623
sistana-stargazing: buggy patch
GreyElaina Sep 25, 2024
fa20e28
sistana: patch with debug method controlled by param
GreyElaina Sep 25, 2024
b245fd0
refactor(sistana): new snapshot model
GreyElaina Oct 4, 2024
bd9574a
sistana: better main/alter processing
GreyElaina Oct 4, 2024
66cd737
sistana: improve prof
GreyElaina Oct 4, 2024
87f9606
sistana: improve perf
GreyElaina Oct 5, 2024
8e708d7
feat(sistana): snapshot enter_{subcommand, option}
GreyElaina Oct 5, 2024
49c12e9
sistana: improve prof
GreyElaina Oct 5, 2024
d729e67
sistana: improve performance
GreyElaina Oct 5, 2024
9124a51
sistana: improve performance, 1-10% less
GreyElaina Oct 5, 2024
151b237
sistana: remove unused
GreyElaina Oct 5, 2024
b0e05cd
sistana: improve perf, remove unused / unnecessary
GreyElaina Oct 6, 2024
7d17c99
feat(sistana): implement option separator
GreyElaina Oct 7, 2024
87ffddb
sistana: simplify logic, swap branches and improve perf
GreyElaina Oct 8, 2024
0f549d4
sistana: drop triehard, implement compact
GreyElaina Oct 8, 2024
63ed61b
sistana: use cached trigger
GreyElaina Oct 8, 2024
532d04f
sistana: remove unused import
GreyElaina Oct 8, 2024
da71338
sistana: fix option trigger
GreyElaina Oct 8, 2024
425ed4d
test: sistana
GreyElaina Oct 9, 2024
2062d09
sistana: fix: fragments order check
GreyElaina Oct 9, 2024
ee3b3f5
sistana: fix non-consist naming
GreyElaina Oct 9, 2024
dcec943
sistana: fix wrong exit reason
GreyElaina Oct 9, 2024
a1e5756
sistana: fix determined instant exit
GreyElaina Oct 9, 2024
ce2567b
sistana: add tests
GreyElaina Oct 9, 2024
7d9d423
sistana: remove unused args
GreyElaina Oct 9, 2024
c47c678
sistana: remove unused protected helper method
GreyElaina Oct 9, 2024
c064017
sistana: fix satisfied check
GreyElaina Oct 9, 2024
7ab5e5d
sistana: fix header edge case
GreyElaina Oct 9, 2024
2247411
Refactor test_analyze.py and test_pattern.py
GreyElaina Oct 9, 2024
a25ca9d
sistana: basically acceptable
GreyElaina Oct 9, 2024
d8149ab
sistana: format
GreyElaina Oct 9, 2024
1872570
test: ruffed
GreyElaina Oct 9, 2024
fc3dde9
Update dependencies in pyproject.toml
GreyElaina Oct 9, 2024
b1c5fa9
Update Python versions in test workflow
GreyElaina Oct 9, 2024
4b3058e
chore: bump pyright target python to 3.9
GreyElaina Oct 10, 2024
e58e218
sistana: fix nepattern
GreyElaina Oct 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
sistana: add comments to CLARIFY
GreyElaina committed Sep 22, 2024
commit 8169fb8fd6073aea06ac4c50fd85197a0752cba0
8 changes: 8 additions & 0 deletions src/arclet/alconna/sistana/analyzer.py
GreyElaina marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -156,6 +156,8 @@ def loopflow(self, snapshot: AnalyzeSnapshot[T], buffer: Buffer[T]) -> LoopflowD

token.apply() # 在最后才 apply,因为上面会根据 duplicate 的情况判定 panic,不能一开始就吃掉。
continue
# else: 给我进 soft keycmd 的 track process (在那之前会先判断 / 分割 compact segment).
# else: 进了 track process.
elif pointer_type == "option":
option_traverse = traverse.option_traverses[-1]

@@ -214,6 +216,7 @@ def loopflow(self, snapshot: AnalyzeSnapshot[T], buffer: Buffer[T]) -> LoopflowD
mix.pop_track(option.keyword)

continue
# else: 进了 track process.

if context.compact_keywords is not None:
prefix = context.compact_keywords.get_closest_prefix(token.val)
@@ -265,6 +268,8 @@ def loopflow(self, snapshot: AnalyzeSnapshot[T], buffer: Buffer[T]) -> LoopflowD
if response is None:
# track 上没有 fragments 可供分配了,此时又没有再流转到其他 traverse
return LoopflowDescription.unexpected_segment
# else: next loop,因为没有 OutOfData。
# 即使有,上面也已经给你处理了。
elif pointer_type == "option":
# option fragments 的处理是原子性的,整段成功才会 apply changes,否则会被 reset。
option = context.options[pointer_val]
@@ -296,3 +301,6 @@ def loopflow(self, snapshot: AnalyzeSnapshot[T], buffer: Buffer[T]) -> LoopflowD

if option.allow_duplicate:
mix.pop_track(option.keyword)
# else: 如果不允许 duplicate,就没必要 pop (幂等操作嘛)
# else: 还是 enter next loop
# 无论如何似乎都不会到这里来,除非 track process 里有个组件惊世智慧的拿到 snapshot 并改了 traverse.ref。