package xm::code::vars;
use strict;

BEGIN {
	use Exporter;
	use vars qw(@EXPORT_OK @EXPORT %EXPORT_TAGS %LANGUAGE);
        use subs qw(xx);
        @EXPORT = qw( %vars %LANGUAGE %ENTITIIES );
	@EXPORT_OK = qw( checkTabulator);
	%EXPORT_TAGS = ( FIELDS => [ @EXPORT, @EXPORT_OK ] );
}
use vars @EXPORT;
sub import { goto &Exporter::import }

# ---------------------------------------------------------------- #
sub xx
{
    return defined $_[0] ? $_[0] : ""
}
# ---------------------------------------------------------------- #

sub checkTabulator
{
    my ($line, $TABSTOP) = @_;
    
    while ((my $at = index($line, "\t")) != -1)
      {
          my $cnt = ($TABSTOP - ($at % $TABSTOP));
          my $replace_with = ' ' x $cnt if ($cnt);
          $line =~ s/\t/$replace_with/;
      };

    return $line;
}

1;