Add warnings for obvious syntax errors in format strings.
authorLudovic Courtès <ludo@gnu.org>
Sun, 10 Oct 2010 17:08:11 +0000 (19:08 +0200)
committerLudovic Courtès <ludo@gnu.org>
Sun, 10 Oct 2010 17:10:11 +0000 (19:10 +0200)
commit8e6c15a6f0425c7891ab3bdf267d56c1ac5804ae
tree53b578c8f16d466b7e27a46636234ccb946378b9
parent60f01304ee7bf3fca8d58ceca7aa122fd62c8910
Add warnings for obvious syntax errors in format strings.

* module/language/tree-il/analyze.scm (&syntax-error): New variable.
  (format-string-argument-count): Throw to &SYNTAX-ERROR when a syntax
  error in a format string is encountered.
  (format-analysis): Catch &SYNTAX-ERROR and convert as a warning of the
  appropriate type.

* module/system/base/message.scm (%warning-types)[format]: Handle
  `syntax-error' warnings.

* test-suite/tests/tree-il.test
  ("warnings")["conditionals"]("unterminated", "unexpected ~;",
  "unexpected ~]"): New tests.
  ["unterminated ~{...~}"]: New test.
module/language/tree-il/analyze.scm
module/system/base/message.scm
test-suite/tests/tree-il.test