Subversion Repositories gelsvn

Rev

Rev 107 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 107 Rev 198
Line 354... Line 354...
354
    }
354
    }
355
    elsif ($line =~ /^}$/) {
355
    elsif ($line =~ /^}$/) {
356
      ($status, $errorString) = $self->handle_scoped_end($type, $flags);
356
      ($status, $errorString) = $self->handle_scoped_end($type, $flags);
357
      last;
357
      last;
358
    }
358
    }
359
    elsif (defined $elseflags && $line =~ /^}\s*else\s*{$/) {
359
    elsif ($line =~ /^}\s*else\s*{$/) {
-
 
360
      if (defined $elseflags) {
360
      ## From here on out anything after this goes into the $elseflags
361
        ## From here on out anything after this goes into the $elseflags
361
      $flags = $elseflags;
362
        $flags = $elseflags;
362
      $elseflags = undef;
363
        $elseflags = undef;
363
 
364
 
364
      ## We need to adjust the type also.  If there was a type
365
        ## We need to adjust the type also.  If there was a type
365
      ## then the first part of the clause was used.  If there was
366
        ## then the first part of the clause was used.  If there was
366
      ## no type, then the first part was ignored and the second
367
        ## no type, then the first part was ignored and the second
367
      ## part will be used.
368
        ## part will be used.
368
      if (defined $type) {
369
        if (defined $type) {
369
        $type = undef;
370
          $type = undef;
-
 
371
        }
-
 
372
        else {
-
 
373
          $type = $self->get_default_component_name();
-
 
374
        }
370
      }
375
      }
371
      else {
376
      else {
-
 
377
        $status = 0;
372
        $type = $self->get_default_component_name();
378
        $errorString = 'An else is not allowed in this context';
-
 
379
        last;
373
      }
380
      }
374
    }
381
    }
375
    else {
382
    else {
376
      my(@values) = ();
383
      my(@values) = ();
377
      if ($self->parse_assignment($line, \@values)) {
384
      if (defined $validNames && $self->parse_assignment($line, \@values)) {
378
        if (defined $$validNames{$values[1]}) {
385
        if (defined $$validNames{$values[1]}) {
379
          if ($values[0] eq 'assignment') {
386
          if ($values[0] eq 'assignment') {
380
            $self->process_assignment($values[1], $values[2], $flags);
387
            $self->process_assignment($values[1], $values[2], $flags);
381
          }
388
          }
382
          elsif ($values[0] eq 'assign_add') {
389
          elsif ($values[0] eq 'assign_add') {
Line 426... Line 433...
426
 
433
 
427
  if (opendir($dh, $dir)) {
434
  if (opendir($dh, $dir)) {
428
    my($need_dir) = ($dir ne '.');
435
    my($need_dir) = ($dir ne '.');
429
    my($skip)     = 0;
436
    my($skip)     = 0;
430
    foreach my $file (grep(!/^\.\.?$/, readdir($dh))) {
437
    foreach my $file (grep(!/^\.\.?$/, readdir($dh))) {
431
      if ($^O eq 'VMS') {
-
 
432
        $file =~ s/\.dir$//;
438
      $file =~ s/\.dir$// if ($^O eq 'VMS');
433
      }
439
 
434
      ## Prefix each file name with the directory only if it's not '.'
440
      ## Prefix each file name with the directory only if it's not '.'
435
      my($full) = ($need_dir ? "$dir/" : '') . $file;
441
      my($full) = ($need_dir ? "$dir/" : '') . $file;
436
 
442
 
437
      if (defined $$exclude[0]) {
443
      if (defined $$exclude[0]) {
438
        foreach my $exc (@$exclude) {
444
        foreach my $exc (@$exclude) {
Line 509... Line 515...
509
  my($fh)      = new FileHandle();
515
  my($fh)      = new FileHandle();
510
  my(@files)   = ();
516
  my(@files)   = ();
511
 
517
 
512
  if (opendir($fh, $dir)) {
518
  if (opendir($fh, $dir)) {
513
    foreach my $file (grep(!/^\.\.?$/, readdir($fh))) {
519
    foreach my $file (grep(!/^\.\.?$/, readdir($fh))) {
514
      if ($^O eq 'VMS') {
-
 
515
        $file =~ s/\.dir$//;
520
      $file =~ s/\.dir$// if ($^O eq 'VMS');
516
      }
521
 
517
      my($skip) = 0;
522
      my($skip) = 0;
518
      my($full) = ($dir ne '.' ? "$dir/" : '') . $file;
523
      my($full) = ($dir ne '.' ? "$dir/" : '') . $file;
519
 
524
 
520
      ## Check for command line exclusions
525
      ## Check for command line exclusions
521
      if (defined $$exclude[0]) {
526
      if (defined $$exclude[0]) {
Line 657... Line 662...
657
    ## or at the end of the line (single values are always at the end
662
    ## or at the end of the line (single values are always at the end
658
    ## of the line).
663
    ## of the line).
659
    if ($nval =~ s/$value\s+// || $nval =~ s/$value$//) {
664
    if ($nval =~ s/$value\s+// || $nval =~ s/$value$//) {
660
      $self->process_assignment($name, $nval, $assign);
665
      $self->process_assignment($name, $nval, $assign);
661
    }
666
    }
-
 
667
    else {
-
 
668
      ## Try the same thing only with double quotes around the value.
-
 
669
      ## Double quotes will be preserved in the value when the value
-
 
670
      ## contains spaces.
-
 
671
      $value = '"' . $value . '"';
-
 
672
      if ($nval =~ s/$value\s+// || $nval =~ s/$value$//) {
-
 
673
        $self->process_assignment($name, $nval, $assign);
-
 
674
      }
-
 
675
    }
662
  }
676
  }
663
}
677
}
664
 
678
 
665
 
679
 
666
sub fill_type_name {
680
sub fill_type_name {