Chess-Plisco

 view release on metacpan or  search on metacpan

lib/Chess/Plisco/Macro.pm  view on Meta::CPAN

#! /bin/false

# Copyright (C) 2021-2026 Guido Flohr <guido.flohr@cantanea.com>,
# all rights reserved.

# This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What the Fuck You Want
# to Public License, Version 2, as published by Sam Hocevar. See
# http://www.wtfpl.net/ for more details.

package Chess::Plisco::Macro;
$Chess::Plisco::Macro::VERSION = 'v1.0.3';
use strict;

use Filter::Util::Call;
use PPI::Document;

sub _define;
sub _define_from_file;
sub preprocess;
sub _extract_arguments;
sub _split_arguments;
sub _expand;
sub _expand_placeholders;
sub _expand_placeholder;

my %defines;

# The no-op empty subroutines only exist so that Pod::Coverage works
# correctly.
_define cp_pos_white_pieces => '$p', '$p->[CP_POS_WHITE_PIECES]';
sub cp_pos_white_pieces {}
_define cp_pos_black_pieces => '$p', '$p->[CP_POS_BLACK_PIECES]';
sub cp_pos_black_pieces {}
_define cp_pos_pawns => '$p', '$p->[CP_POS_PAWNS]';
sub cp_pos_pawns {}
_define cp_pos_knights => '$p', '$p->[CP_POS_KNIGHTS]';
sub cp_pos_knights {}
_define cp_pos_bishops => '$p', '$p->[CP_POS_BISHOPS]';
sub cp_pos_bishops {}
_define cp_pos_queens => '$p', '$p->[CP_POS_QUEENS]';
sub cp_pos_queens {}
_define cp_pos_rooks => '$p', '$p->[CP_POS_ROOKS]';
sub cp_pos_rooks {}
_define cp_pos_kings => '$p', '$p->[CP_POS_KINGS]';
sub cp_pos_kings {}
_define cp_pos_halfmoves => '$p', '$p->[CP_POS_HALFMOVES]';
sub cp_pos_halfmoves {}
_define cp_pos_signature => '$p', '$p->[CP_POS_SIGNATURE]';
sub cp_pos_signature {}
_define cp_pos_last_move => '$p', '$p->[CP_POS_LAST_MOVE]';
sub cp_pos_last_move {}
_define cp_pos_castling_rights => '$p', '$p->[CP_POS_CASTLING_RIGHTS]';
sub cp_pos_castling_rights {}
_define cp_pos_white_king_side_castling_right => '$p',
		'($p->[CP_POS_CASTLING_RIGHTS] & 1)';
sub cp_pos_white_king_side_castling_right {}
_define cp_pos_white_queen_side_castling_right => '$p',
		'(($p->[CP_POS_CASTLING_RIGHTS] & 2))';
sub cp_pos_white_queen_side_castling_right {}
_define cp_pos_black_king_side_castling_right => '$p',
		'(($p->[CP_POS_CASTLING_RIGHTS] & 4))';
sub cp_pos_black_king_side_castling_right {}
_define cp_pos_black_queen_side_castling_right => '$p',
		'($p->[CP_POS_CASTLING_RIGHTS] & 8)';
sub cp_pos_black_queen_side_castling_right {}
_define cp_pos_turn => '$p', '$p->[CP_POS_TURN]';
sub cp_pos_turn {}
_define cp_pos_to_move => '$p', '$p->[CP_POS_TURN]';
sub cp_pos_to_move {}
_define cp_pos_en_passant_shift => '$p', '$p->[CP_POS_EN_PASSANT_SHIFT]';
sub cp_pos_en_passant_shift {}



( run in 1.024 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )