Ignore commented GDK table rows #2681

Open
github-bot wants to merge 2 commits from github-bot/gh-2681 into main AGit
Owner

@⁠luckyteagirl on GitHub · 2026-11-26 05:56 UTC · original
luckyteagirl:codex/gdk-table-ignore-comments → main · +48 −0 · 2 files · 2 commits · open

gen_gdk_table.py picked up API rows inside // and /* ... */ comments. This made disabled rows appear in the generated Rust table.

What is in it

  • Read the Source field from the original input, then remove comments before matching API rows. Preserve quoted fields while stripping so // or /* inside a field does not swallow the active row.
  • Add a synthetic CLI fixture with a source URL, active rows, a quoted slash sequence, a commented-out line, and a commented-out block.

Tested

  • On main b49be183, the fixture emitted both commented-out rows. With the patch, it emitted only the active row and preserved the full source URL.
  • A follow-up fixture failed before the quote-aware fix because a quoted // swallowed the following active row; it passes on head 49973864.
  • python -B -m unittest discover -s scripts -p 'test_*.py': 26 passed, 0 failed, 0 skipped on Windows with Python 3.11.
  • A temporary composition of this PR with #2658 and #2724 passed all 28 Python script tests, including a commented malformed GUID and an active malformed GUID containing //.
  • git diff --check passed.

Regression run

  • Not applicable. This change only affects the generator and its test.

Not tested

  • Regeneration from a real GDK extraction, Rust or GPU tests, or a retail title run. The regression uses synthetic input.

AI use

  • Codex (GPT-6.2 Sol) implemented the original change and test, and a second GPT-6.2 Sol agent implemented the quote-aware follow-up. Codex (GPT-6.2 Astra) reviewed the diffs, tested the combined branches, and updated this description.
**@⁠luckyteagirl** on GitHub · 2026-11-26 05:56 UTC · [original](https://github.com/xcl-dev/xcl/pull/2681) `luckyteagirl:codex/gdk-table-ignore-comments` → `main` · +48 −0 · 2 files · 2 commits · open `gen_gdk_table.py` picked up API rows inside `//` and `/* ... */` comments. This made disabled rows appear in the generated Rust table. **What is in it** - Read the `Source` field from the original input, then remove comments before matching API rows. Preserve quoted fields while stripping so `//` or `/*` inside a field does not swallow the active row. - Add a synthetic CLI fixture with a source URL, active rows, a quoted slash sequence, a commented-out line, and a commented-out block. **Tested** - On main `b49be183`, the fixture emitted both commented-out rows. With the patch, it emitted only the active row and preserved the full source URL. - A follow-up fixture failed before the quote-aware fix because a quoted `//` swallowed the following active row; it passes on head `49973864`. - `python -B -m unittest discover -s scripts -p 'test_*.py'`: 26 passed, 0 failed, 0 skipped on Windows with Python 3.11. - A temporary composition of this PR with #2658 and #2724 passed all **28 Python script tests**, including a commented malformed GUID and an active malformed GUID containing `//`. - `git diff --check` passed. **Regression run** - Not applicable. This change only affects the generator and its test. **Not tested** - Regeneration from a real GDK extraction, Rust or GPU tests, or a retail title run. The regression uses synthetic input. **AI use** - Codex (GPT-6.2 Sol) implemented the original change and test, and a second GPT-6.2 Sol agent implemented the quote-aware follow-up. Codex (GPT-6.2 Astra) reviewed the diffs, tested the combined branches, and updated this description.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:15:25 +00:00
Skip comment tokens without swallowing the rest of a row containing quoted slashes. Keep malformed active fields visible for validation and ignore malformed rows in comments.

Assisted-by: OpenAI Codex (GPT-6.2 Sol)
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2681/head:github-bot/gh-2681'
git switch 'github-bot/gh-2681'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2681'
git switch 'github-bot/gh-2681'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2681'
git switch 'github-bot/gh-2681'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2681'
git switch 'main'
git merge --squash 'github-bot/gh-2681'
git switch 'main'
git merge --ff-only 'github-bot/gh-2681'
git switch 'main'
git merge 'github-bot/gh-2681'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.