Skip to content

Shadow variables fix, missing headers and APIs#70

Merged
winapiadmin merged 2 commits into
mainfrom
shadow_var_fix
Jun 22, 2026
Merged

Shadow variables fix, missing headers and APIs#70
winapiadmin merged 2 commits into
mainfrom
shadow_var_fix

Conversation

@winapiadmin

Copy link
Copy Markdown
Owner

Fixes:

  • Variable shadowing
  • Missing header (, tested using the stl repo)
    Adds:
  • history_size

No functional changes

@winapiadmin winapiadmin merged commit d87250c into main Jun 22, 2026
1 of 2 checks passed
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: bb7eaf7a-3625-410a-b93a-0d157e668bce

📥 Commits

Reviewing files that changed from the base of the PR and between b7e65d6 and 945fe9f.

📒 Files selected for processing (4)
  • moves_io.cpp
  • moves_io.h
  • position.h
  • types.h

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added history_count() method to query the current move history size.
  • Bug Fixes

    • Improved error handling in SAN move notation parsing with automatic recovery from malformed input when enabled.
  • Refactor

    • do_null_move() is now deprecated; use doNullMove() instead.

Walkthrough

Renames the parseSan template parameter from san to raw_san in moves_io.cpp and moves_io.h, fixes the remove_illegals trim-retry loop to use that name consistently, converts parse_san and move_to_san aliases to inline definitions, adds <cctype> and <algorithm> includes, and adds history_count() plus a [[deprecated]] attribute on do_null_move() in position.h.

Changes

SAN Parsing Cleanup

Layer / File(s) Summary
parseSan parameter rename and remove_illegals fix
types.h, moves_io.cpp
Adds <algorithm> to types.h and <cctype> to moves_io.cpp, renames the parseSan parameter to raw_san in documentation and implementation, and fixes the remove_illegals branch to initialize trimmed_san from raw_san, error with raw_san on empty, and call do_parse(raw_san) on the direct path.
Inline alias wrappers
moves_io.h
Updates parse_san to an inline template forwarding to parseSan with raw_san parameter, and move_to_san to an inline template forwarding to moveToSan.

Position API Additions

Layer / File(s) Summary
history_count, do_null_move deprecation, undo_move reformat
position.h
Reformats undo_move declaration, marks do_null_move() with [[deprecated("Pending to remove")]], and adds inline size_t history_count() const returning history.size().

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 A rabbit once parsed a SAN string with care,
Renamed it raw_san — much cleaner, more fair!
With remove_illegals trimming each char,
history_count() now counts near and far.
do_null_move deprecated with style,
These tidy small hops make the codebase worthwhile! 🌿

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch shadow_var_fix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@winapiadmin winapiadmin deleted the shadow_var_fix branch June 22, 2026 02:55

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 945fe9f83e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread position.h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant