
package Text::Wigwam::Engine::Totem::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] } }
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::Totem::Paint::Token->new(
            $tokn->{DRAW}[0],
            $core->curr_addr,
            $tokn->type || 'directive',
        )
    ;

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

1;
