Changeset 639 in genapp


Ignore:
Timestamp:
Feb 17, 2016, 8:54:04 AM (6 years ago)
Author:
ehb
Message:

fix to JSON error reporting for comments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • etc/perl/genapp_util.pl

    r638 r639  
    690690        my $i;
    691691        my $cpos = $cp;
    692         for ( $i = 0; $i < @l; ++$i ) {
    693             next if $l[ $i ] =~ /^\s*#/;
    694             $cpos -= length( $l[ $i ] );
     692        for ( $i = 0; $i < @ol; ++$i ) {
     693            next if $ol[ $i ] =~ /^\s*#/;
     694            $cpos -= length( $ol[ $i ] );
    695695            last if $cpos <= 0;
    696696        }
     
    699699        my $eline = $i + 2;
    700700        $sline = 0 if $sline < 0;
    701         $eline = @l - 1 if $eline >= @l;
     701        $eline = @ol - 1 if $eline >= @ol;
    702702
    703703        print "JSON Error in file $f near these lines:\n";
    704704        for ( my $j = $sline; $j <= $eline; ++$j ) {
    705             print "$j: $l[$j]";
    706             print "$j: " .'^'x(length($l[$j])) . "\n" if $j == $i;
     705            my $uj = $j + 1;
     706            print "$uj: $ol[$j]";
     707            print "$uj: " .'^'x(length($ol[$j])) . "\n" if $j == $i;
    707708        }
    708709        die;
Note: See TracChangeset for help on using the changeset viewer.