You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Port libobs/util/cf-parser.c.h (the former cf-parser.c) to obs-util: cf_adderror and cf_pass_pair.
Phase and position
Phase 3, lexer/parser step 3, deferred follow-up tracked by #43.
Dependencies and existing tests
Uses the lexer/token structures, error-data helpers and dstr formatting. These dependencies are already available through the existing C API and Rust utility ports. The preprocessor in cf-lexer.c.h stays C.
test/cmocka/test_cf_lexer.c already contains parser pair-skipping, error-reporting and parse-failure characterization. First audit that coverage; submit a separate C-only characterization PR only if needed before the Rust port.
Notes
Preserve public headers, exported signatures, parser/token layouts and existing C tests. The eventual port requires RED then GREEN, Tier 1 mirrors, layout checks, differential parity and unchanged Tier 2 OFF/ON checks. Header-inline parser helpers remain unchanged. No intended behavior changes.
Current authorized work is the claim and characterization audit, plus a characterization-only PR if necessary; Rust implementation follows separately.
Claiming: libobs/util/cf-parser.c.h (cf_adderror and cf_pass_pair).
Audit the existing parser characterization in test/cmocka/test_cf_lexer.c against the two C functions and their registration.
If coverage needs strengthening before the port, add separate C tests without changing existing tests or public headers, and submit a characterization-only PR.
Record the audit outcome here. Rust RED/GREEN implementation is a separate next step.
ETA: audit this session; first characterization PR this session if needed. No Rust implementation in this pass.
Audited master 9d58d5ee5e09253c41242f6e05a32df410f35033. A separate characterization PR is not necessary for this two-function unit: existing C characterization covers both exports and is registered against libobs.
test/cmocka/test_cf_lexer.c:418, parser_pass_pair_test: skips a balanced pair, checks the immediate token position after the closing delimiter, handles nested same-kind pairs, fails an unbalanced pair at the terminator, preserves the cursor when not on an opener, and checks allocation balance.
test/cmocka/test_cf_lexer.c:477, parser_adderror_test: covers plain and substituted messages, error/warning levels and counts, filename and row/column, the combined diagnostic text, and allocation balance.
parser_parse_failure_test also covers empty input and failed lexing through the existing header-inline parser setup.
All three are registered in the executable's cmocka array. test/cmocka/CMakeLists.txt:283-288 links test_cf_lexer to OBS::libobs, adds it to cmocka-tests, and registers it with CTest. The Tier 2 harness runs that CTest suite against both libobs variants.
libobs/build/libobs.util-cf+.h.c still includes the original parser implementation. The current test reaches the real C exports, rather than a copied test implementation.
This is sufficient existing characterization under the policy's "Characterization tests for units without C tests" rule. It is not exhaustive coverage. The port's Tier 1 edge cases and Tier 3 parity should additionally cover calls starting at EOF, a nonmatching punctuation opener, nested EOF failure, empty pairs, and substitution values 2/3 (including sparse NULL arguments), preserving defined C behavior and cursor state. Existing C tests and public headers stay unchanged.
Validation boundary: source and test-registration audit only; no build or test execution in this pass, and no claim of a fresh Tier 2 pass. No source changes, characterization commit, or PR were created. Rust implementation has not started; the requested claim remains in place for the next step.
Closing this. The port is on master as #1467 (797f5b135). cf_adderror and cf_pass_pair are in obs-util, and cf-parser.c.h stays only in the C reference build. cf-lexer is still #1499.
Activity
nathan-v commentedon Oct 20, 2026
Claiming: libobs/util/cf-parser.c.h (
cf_adderrorandcf_pass_pair).test/cmocka/test_cf_lexer.cagainst the two C functions and their registration.ETA: audit this session; first characterization PR this session if needed. No Rust implementation in this pass.
nathan-v commentedon Oct 20, 2026
Characterization audit
Audited master
9d58d5ee5e09253c41242f6e05a32df410f35033. A separate characterization PR is not necessary for this two-function unit: existing C characterization covers both exports and is registered against libobs.test/cmocka/test_cf_lexer.c:418,parser_pass_pair_test: skips a balanced pair, checks the immediate token position after the closing delimiter, handles nested same-kind pairs, fails an unbalanced pair at the terminator, preserves the cursor when not on an opener, and checks allocation balance.test/cmocka/test_cf_lexer.c:477,parser_adderror_test: covers plain and substituted messages, error/warning levels and counts, filename and row/column, the combined diagnostic text, and allocation balance.parser_parse_failure_testalso covers empty input and failed lexing through the existing header-inline parser setup.test/cmocka/CMakeLists.txt:283-288linkstest_cf_lexertoOBS::libobs, adds it tocmocka-tests, and registers it with CTest. The Tier 2 harness runs that CTest suite against both libobs variants.libobs/build/libobs.util-cf+.h.cstill includes the original parser implementation. The current test reaches the real C exports, rather than a copied test implementation.This is sufficient existing characterization under the policy's "Characterization tests for units without C tests" rule. It is not exhaustive coverage. The port's Tier 1 edge cases and Tier 3 parity should additionally cover calls starting at EOF, a nonmatching punctuation opener, nested EOF failure, empty pairs, and substitution values 2/3 (including sparse NULL arguments), preserving defined C behavior and cursor state. Existing C tests and public headers stay unchanged.
Validation boundary: source and test-registration audit only; no build or test execution in this pass, and no claim of a fresh Tier 2 pass. No source changes, characterization commit, or PR were created. Rust implementation has not started; the requested claim remains in place for the next step.
feat(obs-util): GREEN cf-parser C ABI and oracle parity (obs-rust#1466)
obs-util: port cf-parser (obs-rust#1466) (obs-rust#1467)
nathan-v commentedon Oct 21, 2026
Closing this. The port is on master as #1467 (
797f5b135).cf_adderrorandcf_pass_pairare inobs-util, andcf-parser.c.hstays only in the C reference build.cf-lexeris still #1499.