-
Notifications
You must be signed in to change notification settings - Fork 1
/
markup.pl
48 lines (45 loc) · 923 Bytes
/
markup.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/perl
use warnings;
use utf8;
use strict;
my %label_mapping = (
"Intro stage" => ".intro",
"Wire Sponge" => ".sponge",
"Wheel Gator" => ".gator",
"Flame Stag" => ".stag",
"Magna Centipede" => ".centipede",
"Crystal Snail" => ".snail",
"Overdrive Ostrich" => ".ostrich",
"Bubble Crab" => ".crab",
"Morph Moth" => ".moth",
"Violen" => ".violen",
"Serges" => ".serges",
"Agile" => ".agile",
"Boss Repeats" => ".teleporter",
"Sigma" => ".sigma");
while (my $line = <>)
{
if ($line !~ m#//#)
{
$line =~ s/ /,\$/g;
$line = "\tdb \$$line";
}
elsif ($line =~ m#//\s*\d+\.\s*(.*)$#)
{
my $comment = $1;
foreach my $key (keys(%label_mapping))
{
my $regex = "^" . $key;
if ($comment =~ m/$regex/)
{
print("$label_mapping{$key}:\n");
}
}
$line = "\t$line";
}
elsif ($line ne "")
{
$line = "\t$line";
}
print($line);
}