Permalink
Browse files

import version 2.01 from backpan

  • Loading branch information...
1 parent dee3615 commit ecd4c16c2221132f6e89b624101ff007b860a696 @fperrad committed with Mar 14, 2003
Showing with 17 additions and 15 deletions.
  1. +3 −0 Changes
  2. +13 −14 lexer.pm
  3. +1 −1 node.pm
View
@@ -1,5 +1,8 @@
Revision history for Perl extension CORBA::IDL.
+2.01 Fri Mar 14 12:30:00 2003
+ - lexer.pm : add patch for SUN C-preprocessor (thanks to Chad Elliott)
+
2.00 Mon Jan 13 12:30:00 2003
- support CORBA 3.0
- and refactoring (the AST is not compatible with 1.0x version)
View
@@ -220,7 +220,7 @@ sub _EscIdentifier {
if ($Parser::IDL_version ge '2.3') {
my $key = uc $ident;
- if (! exists $parser->YYData->{keyword}{$key}) {
+ unless (exists $parser->YYData->{keyword}{$key}) {
Info("Unnecessary escaped identifier '$ident'.\n");
}
} else {
@@ -346,48 +346,47 @@ sub _Lexer {
or $parser->YYData->{INPUT} = <YYIN>
or return('',undef);
- if (! exists $parser->YYData->{srcname}) {
- if ($parser->YYData->{INPUT} =~ /^# ([\d]+) ["<]([^\s">]+)[">]\n/ ) { # cccp
- $parser->YYData->{srcname} = $2;
- } elsif ($parser->YYData->{INPUT} =~ /^#line ([\d]+) ["<]([^\s">]+)[">]\n/ ) { # CL.EXE
+ unless (exists $parser->YYData->{srcname}) {
+ if ($parser->YYData->{INPUT} =~ /^#\s*(line\s+)?\d+\s+["<]([^\s">]+)[">]\s*\n/ ) {
$parser->YYData->{srcname} = $2;
} else {
print "INTERNAL_ERROR:_Lexer\n";
}
- my @st = stat($parser->YYData->{srcname});
- $parser->YYData->{srcname_size} = $st[7];
- $parser->YYData->{srcname_mtime} = $st[9];
-
+ if (defined $parser->YYData->{srcname}) {
+ my @st = stat($parser->YYData->{srcname});
+ $parser->YYData->{srcname_size} = $st[7];
+ $parser->YYData->{srcname_mtime} = $st[9];
+ }
}
for ($parser->YYData->{INPUT}) {
- s/^# ([\d]+) ["<]([^\s">]+)[">] ([\d]+)\n// # cccp
+ s/^#\s+([\d]+)\s+["<]([^\s">]+)[">]\s+([\d]+)\s*\n// # cccp
and $parser->YYData->{lineno} = $1,
$parser->YYData->{filename} = $2,
$parser->YYData->{doc} = '',
$parser->YYData->{curr_node} = undef,
last;
- s/^# ([\d]+) ["<]([^\s">]+)[">]\n// # cccp
+ s/^#\s+([\d]+)\s+["<]([^\s">]+)[">]\s*\n// # cccp
and $parser->YYData->{lineno} = $1,
$parser->YYData->{filename} = $2,
$parser->YYData->{doc} = '',
$parser->YYData->{curr_node} = undef,
last;
- s/^#line ([\d]+) ["<]([^\s">]+)[">]\n// # CL.EXE Microsoft VC
+ s/^#\s*line\s+([\d]+)\s+["<]([^\s">]+)[">]\s*\n// # CL.EXE Microsoft VC
and $parser->YYData->{lineno} = $1,
$parser->YYData->{filename} = $2,
$parser->YYData->{doc} = '',
$parser->YYData->{curr_node} = undef,
last;
- s/^[ \r\t\f\013]+//; # whitespaces
+ s/^[\s\r\f\013]+//; # whitespaces
s/^\n//
and $parser->YYData->{lineno} ++,
$parser->YYData->{curr_node} = undef,
last;
- s/^#pragma[ \t]+(.*)\n//
+ s/^#pragma\s+(.*)\n//
and $parser->_PragmaLexer($1),
$parser->YYData->{lineno} ++,
$parser->YYData->{curr_node} = undef,
View
@@ -7,7 +7,7 @@ use UNIVERSAL;
package node;
use vars qw($VERSION);
-$VERSION = '2.00';
+$VERSION = '2.01';
sub _Build {
my $proto = shift;

0 comments on commit ecd4c16

Please sign in to comment.