
package Text::Wigwam::Engine::Fusion::Token::Terminator::Fast;

    use strict;
    use warnings;
    our $VERSION = '0.01';

    use base q/Text::Wigwam::Cast/;

    use Text::Wigwam::Const( qw/TERM/ );

    sub new { return bless { DRAW => $_[1], TYPE => $_[2] } }
    sub type { $_[0]->{TYPE} }
    sub exec {
        my ($tokn, $want, $Arg, $Api, $core) = @_;
        $core->next_token;
        $Arg->end_list(1);
        return;
    }
    sub skip {
        my ($tokn, $list, $Arg, $Api, $core) = @_;
        $core->next_token;
        return TERM;
    }
    sub paint {
        my ($tokn, $Arg, $Api, $core) = @_;
        $core->next_token;
        $tokn->{PAINT} ||=
            Text::Wigwam::Engine::Fusion::Paint::Token->new(
                $tokn->{DRAW}[0],
                $core->curr_addr,
                $tokn->type || 'directive',
            )
        ;

        return(
            Text::Wigwam::Engine::Fusion::Paint::Group->new(
                [ $tokn->{PAINT} ]
            ),
            1,
        );
    }

1;
