mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2025-02-28 13:26:58 +00:00
* parser/gapi_pp.pl: Added striping of C comments
svn path=/trunk/gtk-sharp/; revision=15639
This commit is contained in:
parent
9185d37ca2
commit
ff5b07b97a
|
@ -1,3 +1,7 @@
|
||||||
|
2003-06-25 Martin Willemoes Hansen <mwh@sysrq.dk>
|
||||||
|
|
||||||
|
* parser/gapi_pp.pl: Added striping of C comments
|
||||||
|
|
||||||
2003-06-23 Martin Willemoes Hansen <mwh@sysrq.dk>
|
2003-06-23 Martin Willemoes Hansen <mwh@sysrq.dk>
|
||||||
|
|
||||||
* glib/Type.cs: Added ToString
|
* glib/Type.cs: Added ToString
|
||||||
|
|
|
@ -3,9 +3,11 @@
|
||||||
# gapi_pp.pl : A source preprocessor for the extraction of API info from a
|
# gapi_pp.pl : A source preprocessor for the extraction of API info from a
|
||||||
# C library source directory.
|
# C library source directory.
|
||||||
#
|
#
|
||||||
# Author: Mike Kestner <mkestner@speakeasy.net>
|
# Authors: Mike Kestner <mkestner@speakeasy.net>
|
||||||
|
# Martin Willemoes Hansen <mwh@sysrq.dk>
|
||||||
#
|
#
|
||||||
# <c> 2001 Mike Kestner
|
# <c> 2001 Mike Kestner
|
||||||
|
# <c> 2003 Martin Willemoes Hansen
|
||||||
|
|
||||||
$eatit_regex = "^#if.*(__cplusplus|DEBUG|DISABLE_(DEPRECATED|COMPAT)|ENABLE_BROKEN|COMPILATION)";
|
$eatit_regex = "^#if.*(__cplusplus|DEBUG|DISABLE_(DEPRECATED|COMPAT)|ENABLE_BROKEN|COMPILATION)";
|
||||||
$ignoreit_regex = '^\s+\*|#\s*include|#\s*else|#\s*endif|#\s*undef|G_(BEGIN|END)_DECLS|extern|GDKVAR|GTKVAR|GTKMAIN_C_VAR|GTKTYPEUTILS_VAR|VARIABLE|GTKTYPEBUILTIN';
|
$ignoreit_regex = '^\s+\*|#\s*include|#\s*else|#\s*endif|#\s*undef|G_(BEGIN|END)_DECLS|extern|GDKVAR|GTKVAR|GTKMAIN_C_VAR|GTKTYPEUTILS_VAR|VARIABLE|GTKTYPEBUILTIN';
|
||||||
|
@ -130,8 +132,33 @@ foreach $fname (`ls $ARGV[0]/*.c`, @privhdrs) {
|
||||||
print "private";
|
print "private";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$comment = 0;
|
||||||
|
$begin = 0;
|
||||||
|
$end = 0;
|
||||||
do {
|
do {
|
||||||
print $line;
|
# Following ifs strips out // and /* */ C comments
|
||||||
|
if ($line =~ /\/\*/) {
|
||||||
|
$comment = 1;
|
||||||
|
$begin = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($comment != 1) {
|
||||||
|
$line =~ s/\/\/.*//;
|
||||||
|
print $line;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($line =~ /\*\//) {
|
||||||
|
$comment = 0;
|
||||||
|
$end = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($begin == 1 && $end == 1) {
|
||||||
|
$line =~ s/\/\*.*\*\///;
|
||||||
|
print $line;
|
||||||
|
}
|
||||||
|
|
||||||
|
$begin = 0;
|
||||||
|
$end = 0;
|
||||||
} until (($line = <INFILE>) =~ /^}/);
|
} until (($line = <INFILE>) =~ /^}/);
|
||||||
print $line;
|
print $line;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue