|
Revision 3887, 2.9 KB
(checked in by sukyoungryu, 5 months ago)
|
|
[static checker] Fixed a bug handling symmetric exclusion relationship.
Implemented checking that if trait T excludes trait U, no third trait may extend both T and U, nor may either T or U extend the other.
Added tests and eliminated unnecessary excludes clauses in the CompilerBuiltin? library.
Refactored static checker code.
|
-
Property svn:executable set to
*
|
| Line | |
|---|
| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | use XML::Simple; |
|---|
| 20 | use IO::File; |
|---|
| 21 | use strict; |
|---|
| 22 | |
|---|
| 23 | |
|---|
| 24 | my $debug=0; |
|---|
| 25 | |
|---|
| 26 | my $path = $ENV{'FORTRESS_HOME'}; |
|---|
| 27 | if (!$path) { |
|---|
| 28 | print "FORTRESS_HOME must be set"; |
|---|
| 29 | exit; |
|---|
| 30 | } |
|---|
| 31 | |
|---|
| 32 | |
|---|
| 33 | |
|---|
| 34 | chdir $path; |
|---|
| 35 | |
|---|
| 36 | my $checkRev=3300; |
|---|
| 37 | my $checkDate = 2009; |
|---|
| 38 | my $rootDir = $path; |
|---|
| 39 | my $copyright = "Copyright $checkDate "; |
|---|
| 40 | my $maxlines = 10; |
|---|
| 41 | my $ignoreThese = 'ant|fortress-keywords|UserDictionary|README.txt|README$|\.fsg$|\.NW$|fortress.vim|\.ods|\.jar$|\.timing$|\.war$|\.zip$|\.tgz$|\/\.|^\.|^Sandbox'; |
|---|
| 42 | my $tempFile = '/tmp/svnInfo.xml'; |
|---|
| 43 | |
|---|
| 44 | |
|---|
| 45 | my $xmlfh; |
|---|
| 46 | |
|---|
| 47 | if ($debug>1) { |
|---|
| 48 | $xmlfh = new IO::File $tempFile; |
|---|
| 49 | } else { |
|---|
| 50 | $xmlfh = new IO::File 'svn info -R --xml $path |'; |
|---|
| 51 | die("Can't get svn info") if (!$xmlfh); |
|---|
| 52 | } |
|---|
| 53 | |
|---|
| 54 | |
|---|
| 55 | my $xs1 = XML::Simple->new(); |
|---|
| 56 | my $doc = $xs1->XMLin($xmlfh); |
|---|
| 57 | |
|---|
| 58 | $xmlfh->close(); |
|---|
| 59 | |
|---|
| 60 | foreach my $entry ((@{$doc->{entry}})){ |
|---|
| 61 | |
|---|
| 62 | next if ( $entry->{kind} ne 'file' ); |
|---|
| 63 | next if ( $entry->{revision} < $checkRev ); |
|---|
| 64 | next if ( $entry->{commit}->{date} !~ m/$checkDate/); |
|---|
| 65 | next if ( $entry->{path} =~ m/$ignoreThese/ ); |
|---|
| 66 | |
|---|
| 67 | |
|---|
| 68 | my ($line,$cnt,$missingCopyRight); |
|---|
| 69 | $missingCopyRight=1; |
|---|
| 70 | $cnt=0; |
|---|
| 71 | print "opening-> $rootDir/$entry->{path}\n" if ($debug); |
|---|
| 72 | my $fh = new IO::File "$entry->{path}"; |
|---|
| 73 | warn ("Can't open $entry->{path}") if (!$fh); |
|---|
| 74 | while (($line = <$fh> )|| ($cnt++<$maxlines)) { |
|---|
| 75 | print $line if ($debug); |
|---|
| 76 | if ($line =~ m/$copyright/) { |
|---|
| 77 | $missingCopyRight=0; |
|---|
| 78 | last; |
|---|
| 79 | } |
|---|
| 80 | } |
|---|
| 81 | $fh->close(); |
|---|
| 82 | |
|---|
| 83 | if ($missingCopyRight) { |
|---|
| 84 | print "$entry->{path}\n"; |
|---|
| 85 | } |
|---|
| 86 | } |
|---|