feat: sdp.params_get top-level re-export (1.5.0)#7
Merged
Conversation
Re-export grammar.base.params_get on the public module as the inner companion to sdp.attr_get / sdp.attrs_get, so name lookups share one public surface. The grammar.base path still works for existing callers. params_get takes the inner param list (fmtp.params), not a block — documented at the re-export, in the GUIDE, and in a dedicated test. Bumps rockspec to 1.5.0. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Re-exports `sdp.params_get(params, key)` on the public module as the inner companion to `sdp.attr_get` / `sdp.attrs_get`. Looks up a value by key in an ordered `a=fmtp` / `a=privacy` param list — returns the value, `true` for a bare flag, or `nil`.
Before this, 1.4.0 had promoted the outer attribute accessors to the public module but left `params_get` reachable only via `parse_sdp.grammar.base`, leaving the inner companion as the odd one out and forcing consumers to cross into a grammar internal mid-task. This restores one public surface for name lookups. The `grammar.base.params_get` path still works for existing callers.
Requested by the `lnmos` `nmos/sdp.lua` layer, which will switch to `sdp.params_get`.
Caveat (documented everywhere)
Unlike `attr_get` (which takes a block), `params_get` takes the inner list directly — `fmtp.params`, not the `fmtp` table — because param lists have no wrapping object. Documented at the re-export, in the GUIDE API reference, and pinned by a dedicated test (passing the `fmtp` table returns `nil`).
Tests
+5 cases in `spec/library_spec.lua` (value lookup / bare-flag → `true` / miss / nil-safe / takes-list-not-block). Full hermetic suite green in Docker (1222/0/0).
Release
Bumps rockspec to 1.5.0 (additive, backward-compatible). dkjson dependency unchanged.
🤖 Generated with Claude Code