Skip to content

Tags: ttab/newsdoc

Tags

v1.1.0

Toggle v1.1.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
feat(value-extractor): add inline child selector '#(...)' (#17)

* feat(value-extractor): add inline child selector '#(...)'

Add an inline per-selector descendant-existence check `#(...)` that gates
a selector on having matching children without terminating the outer chain
or changing what is yielded. This complements the existing terminal `#`
form, which ends the chain and yields the descendants instead.

- Add BlockSelector.RequireChild, evaluated via the existing
  hasMatchingChildren in BlockSelector.Matches; supports nesting and the
  same filters as the terminal form.
- Replace indexByteOutsideQuotes with terminalHashIndex (quote- and
  paren-depth-aware) so terminal `#` is distinguished from inline `#(`.
- Extract parseSelectorPart, parseInlineChildSelector, and
  matchingCloseParen for readable selector-part parsing.
- Reject inline `#(...)` after a value spec, and error on unexpected
  trailing content after a value spec (previously silently ignored).
- Document the inline form in README and add parse, parse-error, and
  Collect test coverage with golden fixtures.

* refactor(value-extractor): unify terminal '#' into per-selector RequireChild

Replace the top-level ValueExtractor.ChildSelectors field with a
per-selector gate so the terminal '#' and inline '#(...)' forms share one
code path. A terminal '#X' is now folded into a RequireChild chain on the
last selector, exactly as if it were an inline '#(X)'.

- BlockSelector.RequireChild becomes [][]BlockSelector: a list of
  independent descendant chains, all of which must match (conjunctive).
  A selector may carry any number of gates (multiple '#(...)' clauses
  and/or a trailing terminal '#').
- Remove the Collect-time post-filter; gating now happens uniformly in
  BlockSelector.Matches.
- Fix a silent bug: when a terminal '#' appeared both in the selector
  chain and after the value spec, the second overwrote the first and one
  gate was dropped. Both are now accumulated and folded onto the last
  selector.
- Error on a terminal '#' with no preceding parent selector.

BREAKING CHANGE: removes the exported ValueExtractor.ChildSelectors field
(present since v1.0.0). Consumers reading it must migrate to
BlockSelector.RequireChild.

Tests: add inline_child_two_gates and double_terminal_hash parse cases,
TestCollectInlineChildTwoGates / TestCollectDoubleTerminalHash /
TestCollectInlineChildNested behavioral tests, a terminal_hash_no_parent
error case, and TestValueExtractorParseErrorMessages pinning the exact
message of each child-selector guard. README documents the unified model
and conjunctive multi-gate behavior.

v1.0.0

Toggle v1.0.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
update dependencies (#12)

* update dependencies

* bump workflow action versions

v0.9.0

Toggle v0.9.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
update dependencies (#12)

* update dependencies

* bump workflow action versions

v1.0.0-pre2

Toggle v1.0.0-pre2's commit message

Verified

This commit was signed with the committer’s verified signature.
hugowetterberg Hugo Wetterberg
support attributes+data, make commas optional in the value spec

v1.0.0-pre1

Toggle v1.0.0-pre1's commit message

Verified

This commit was signed with the committer’s verified signature.
hugowetterberg Hugo Wetterberg
booelan and nesting support

v0.8.0

Toggle v0.8.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Feature/value extractor (#10)

bump linter workflow versions

v0.7.4

Toggle v0.7.4's commit message

Verified

This commit was signed with the committer’s verified signature.
hugowetterberg Hugo Wetterberg
update dependencies

v0.7.3

Toggle v0.7.3's commit message

Verified

This commit was signed with the committer’s verified signature.
hugowetterberg Hugo Wetterberg
add Clone() method for documents and blocks

v0.7.2

Toggle v0.7.2's commit message

Verified

This commit was signed with the committer’s verified signature.
hugowetterberg Hugo Wetterberg
add AlterFirstblock()

v0.7.1

Toggle v0.7.1's commit message

Verified

This commit was signed with the committer’s verified signature.
hugowetterberg Hugo Wetterberg
add an AllBlocks() selector operation