<commit_before>use bb::*;
use gen::pawn::PAWN_CAPTURE_FILE_MASKS;
use mv_list::MoveList;
use piece::*;
use position::Position;
use side::{Side, WHITE};
use square::Square;
use square;

// Generates pawn moves along pin rays
// NOTE: this is quigte expensive unfortunately
pub fn pawn_pin_ray_moves<L: MoveList>(
    position: &Position,
    capture_mask: BB,
    push_mask: BB,
    king_sq: Square,
    pinned: BB,
    stm: Side,
    list: &mut L,
) {
    let empty_squares = position.bb_empty();
    let piece = PAWN.pc(stm);
    let movers = position.bb_pc(piece) & pinned;

    let push_shift = if stm == WHITE { 8 } else { 64 - 8 };
    let double_push_mask = if stm == WHITE { ROW_4 } else { ROW_5 };

    let can_push = movers & king_sq.file_mask();
    let king_diags = king_sq.both_diagonals();
    let can_capture = movers & king_diags;

    // For pinned pawns, only possible moves are those along the king file
    for (_, pawn) in can_push.iter() {
        let single_pushes = pawn.rot_left(push_shift as u32) & empty_squares & push_mask;
        list.add_pawn_pushes(push_shift, single_pushes);<commit_msg>remove comment<commit_after>use bb::*;
use gen::pawn::PAWN_CAPTURE_FILE_MASKS;
use mv_list::MoveList;
use piece::*;
use position::Position;
use side::{Side, WHITE};
use square::Square;
use square;

// Generates pawn moves along pin rays
pub fn pawn_pin_ray_moves<L: MoveList>(
    position: &Position,
    capture_mask: BB,
    push_mask: BB,
    king_sq: Square,
    pinned: BB,
    stm: Side,
    list: &mut L,
) {
    let empty_squares = position.bb_empty();
    let piece = PAWN.pc(stm);
    let movers = position.bb_pc(piece) & pinned;

    let push_shift = if stm == WHITE { 8 } else { 64 - 8 };
    let double_push_mask = if stm == WHITE { ROW_4 } else { ROW_5 };

    let can_push = movers & king_sq.file_mask();
    let king_diags = king_sq.both_diagonals();
    let can_capture = movers & king_diags;

    // For pinned pawns, only possible moves are those along the king file
    for (_, pawn) in can_push.iter() {
        let single_pushes = pawn.rot_left(push_shift as u32) & empty_squares & push_mask;
        list.add_pawn_pushes(push_shift, single_pushes);
{'fraction_non_alphanumeric': 0.11547238703788225, 'fraction_numerical': 0.00730260155180283, 'mean_word_length': 3.538302277432712, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5065844', 'n_tokens_mistral': 814, 'n_tokens_neox': 784, 'n_words': 216}