blob: 5798264e86f6afab5b728bfbe30f19c65e8eaeee [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001#!/usr/local/bin/perl
2
3$mode = 0;
4$T1="mixed|float|int|string|object|void|quoted_array|symbol|closure|mapping";
5$T2="mixed \*|float \*|int \*|string \*|object \*|void \*|quoted_array \*|symbol \*|closure \*|mixed \&";
6$TYPES="\($T1|$T2\)";
7
8while( <> ) {
9 chop $_;
10 if( $mode == 0 && $_ eq "%efuns" ) {
11 $mode = 1;
12 } elsif( $mode == 1 && $_ eq "%xcodes" ) {
13 $mode = 2;
14 } elsif( $_ =~ "#endif" && $mode == 3 ) {
15 $mode = 1;
16 } elsif( $mode == 1 ) {
17 if( $_ =~ m"#ifndef NATIVE" || $_ =~ m"#ifdef MALLOC_malloc" ) {
18 $mode = 3;
19 } elsif( $_ ne "" && $_ !~ m"^.\*" && $_ !~ "^#" ) {
20 s/default: \w*//;
21 s/$TYPES/mixed/g;
22 print "$_\n";
23 }
24 }
25}