Added a few lines to the setup file parser so that if there is a
missing brace in the file (a common error), then the fact that there is an unevaluated command when the file has finished being read will trigger an evaluation of the unfinished code and emit an error. Previously, the command and anything after the unterminated brace would just silently get ignored, which was not helpful for debugging setup syntax errors.
This commit is contained in:
parent
c0c9993980
commit
ddd95c4fe6
|
|
@ -516,6 +516,14 @@ proc netgen::lvs { name1 name2 {setupfile setup.tcl} {logfile comp.out} args} {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
close $fsetup
|
close $fsetup
|
||||||
|
if {$command != {}} {
|
||||||
|
# Incomplete command. Evaluate it to get a meaningful error message
|
||||||
|
if {[catch {uplevel 1 [list namespace eval netgen $command]} msg]} {
|
||||||
|
set msg [string trimright $msg "\n"]
|
||||||
|
puts stderr "Error $setupfile:$sline (ignoring), $msg"
|
||||||
|
incr perrors
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
puts stdout "Error: Cannot read the setup file $setupfile"
|
puts stdout "Error: Cannot read the setup file $setupfile"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue