aboutsummaryrefslogtreecommitdiff
path: root/install-win32/nsitran.pl
blob: 7c04e40cdde4a5b5bc4e84438d26170d3745f3f0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
($mode) = @ARGV;

while (<STDIN>) {
  chomp;
  if (/^\s*$/) {
    print "\n";
  } elsif (/^[#;](.*)$/) {
    print "//$1\n" if ($mode eq "c");
    print "#$1\n" if ($mode eq "sh");
    print "//$1\n" if ($mode eq "js");
  } elsif (/^!define\s+(\w+)\s+(.+)$/) {
    print "#define $1 $2\n" if ($mode eq "c");
    print "export $1=$2\n" if ($mode eq "sh");
    print "var $1=$2;\n" if ($mode eq "js");
  }
}