Updating FindMessages.tcl to support `filter_objs` expressions (and update `messages.txt`)
This commit is contained in:
parent
93005762b3
commit
677a905bd3
959
doc/messages.txt
959
doc/messages.txt
File diff suppressed because it is too large
Load Diff
|
|
@ -13,7 +13,7 @@ exec tclsh $0 ${1+"$@"}
|
||||||
# Find warning/error message IDs and detect collisions.
|
# Find warning/error message IDs and detect collisions.
|
||||||
# Usage: FindMessages.tcl > doc/messages.txt
|
# Usage: FindMessages.tcl > doc/messages.txt
|
||||||
|
|
||||||
proc scan_file { file warn_regexp } {
|
proc scan_file { file warn_regexp is_filter_objs } {
|
||||||
global msgs
|
global msgs
|
||||||
|
|
||||||
if { [file exists $file] } {
|
if { [file exists $file] } {
|
||||||
|
|
@ -22,7 +22,11 @@ proc scan_file { file warn_regexp } {
|
||||||
set file_line 1
|
set file_line 1
|
||||||
|
|
||||||
while { ![eof $in_stream] } {
|
while { ![eof $in_stream] } {
|
||||||
if { [regexp -- $warn_regexp $line ignore1 ignore2 msg_id msg] } {
|
if { !$is_filter_objs && [regexp -- $warn_regexp $line ignore1 ignore2 msg_id msg] } {
|
||||||
|
lappend msgs "$msg_id $file $file_line $msg"
|
||||||
|
}
|
||||||
|
if { $is_filter_objs && [regexp -- $warn_regexp $line ignore1 ignore2 object_type msg_id] } {
|
||||||
|
set msg "\"unsupported $object_type -filter expression.\""
|
||||||
lappend msgs "$msg_id $file $file_line $msg"
|
lappend msgs "$msg_id $file $file_line $msg"
|
||||||
}
|
}
|
||||||
gets $in_stream line
|
gets $in_stream line
|
||||||
|
|
@ -48,10 +52,11 @@ foreach subdir $subdirs {
|
||||||
set files_tcl [concat $files_tcl [glob -nocomplain [file join $subdir "*.tcl"]]]
|
set files_tcl [concat $files_tcl [glob -nocomplain [file join $subdir "*.tcl"]]]
|
||||||
}
|
}
|
||||||
set warn_regexp_tcl {(sta_warn|sta_error|sta_warn_error) ([0-9]+) (".+")}
|
set warn_regexp_tcl {(sta_warn|sta_error|sta_warn_error) ([0-9]+) (".+")}
|
||||||
|
set warn_regexp_tcl_filter_objs {(filter_objs) \S+ \S+ \S+ "([^"]+)" ([0-9]+)}
|
||||||
|
|
||||||
proc scan_files {files warn_regexp } {
|
proc scan_files {files warn_regexp is_filter_objs } {
|
||||||
foreach file $files {
|
foreach file $files {
|
||||||
scan_file $file $warn_regexp
|
scan_file $file $warn_regexp $is_filter_objs
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -79,7 +84,8 @@ proc report_msgs { } {
|
||||||
}
|
}
|
||||||
|
|
||||||
set msgs {}
|
set msgs {}
|
||||||
scan_files $files_c $warn_regexp_c
|
scan_files $files_c $warn_regexp_c 0
|
||||||
scan_files $files_tcl $warn_regexp_tcl
|
scan_files $files_tcl $warn_regexp_tcl 0
|
||||||
|
scan_files $files_tcl $warn_regexp_tcl_filter_objs 1
|
||||||
check_msgs
|
check_msgs
|
||||||
report_msgs
|
report_msgs
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue