tool/fix_include_ifndef: consider license header

devel
Norman Feske 9 years ago committed by Christian Helmuth
parent 8ca0f04ba0
commit 6efac7672f
  1. 37
      tool/fix_include_ifndef

@ -37,7 +37,7 @@ proc out {txtline} {
foreach line $lines {
incr i
if {$state == "comment_header_begin"} {
if {[regexp {^/*} $line]} {
set state comment_header
@ -68,6 +68,41 @@ foreach line $lines {
puts "Error (line $i): no empty line after comment header"
exit -1;
}
set state license_header_begin
out $line
continue
}
if {$state == "license_header_begin"} {
if {[regexp {^/*} $line]} {
set state license_header
out $line
continue
} else {
puts stderr "Error (line $i): missing license header"
exit -1;
}
}
if {$state == "license_header"} {
if {[regexp {^ \*/} $line]} {
set state empty_line_after_license_header
out $line
continue;
}
if {[regexp {^ \*[^/]*} $line]} {
out $line
continue
}
puts "Error (line $i): non-complient license header"
exit -1;
}
if {$state == "empty_line_after_license_header"} {
if {![regexp {^$} $line]} {
puts "Error (line $i): no empty line after license header"
exit -1;
}
set state ifndef
out $line
continue

Loading…
Cancel
Save