diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-02-19 00:02:04 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-02-19 00:02:04 +0800 |
commit | d930cd953212d3544b86763f1ce492a1ade87b9f (patch) | |
tree | f6c7fabcbfa1e350dc35097b6a0148dd2cd4fea4 /util | |
parent | c3403048ab4f47341514d1e37f06984f441cae76 (diff) | |
download | pttbbs-d930cd953212d3544b86763f1ce492a1ade87b9f.tar pttbbs-d930cd953212d3544b86763f1ce492a1ade87b9f.tar.gz pttbbs-d930cd953212d3544b86763f1ce492a1ade87b9f.tar.bz2 pttbbs-d930cd953212d3544b86763f1ce492a1ade87b9f.tar.lz pttbbs-d930cd953212d3544b86763f1ce492a1ade87b9f.tar.xz pttbbs-d930cd953212d3544b86763f1ce492a1ade87b9f.tar.zst pttbbs-d930cd953212d3544b86763f1ce492a1ade87b9f.zip |
rewrite
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2520 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'util')
-rw-r--r-- | util/parsevar.pl | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/util/parsevar.pl b/util/parsevar.pl index fe2f2dc0..97689a19 100644 --- a/util/parsevar.pl +++ b/util/parsevar.pl @@ -13,8 +13,15 @@ print << '.'; while( <> ){ if( /^\w/ ){ chomp; - $_ = substr($_, 0, index($_, '=') - 1) if( index($_, '=') != -1 ); + s|//.*||; + s|/\*.*?\*/||; + s/\=\s*\{.*?\}//; + + s/\=.*?([,;])/$1/g; + s/\=.*?\{//g; $_ .= ';' if( index($_, ';') == -1 ); + s/\=.*?([,;])/$1/g; + s/\=.*?\{//g; print "extern $_\n"; } elsif( /^\s*\#/ && !/include/ ){ print; |