Next: , Previous: Starting the syntax check process, Up: Flymake Implementation

5.7 Parsing the output

The output generated by the syntax check tool is parsed in the process filter/sentinel using the error message patterns stored in the flymake-err-line-patterns variable. This variable contains a list of items of the form (regexp file-idx line-idx err-text-idx), used to determine whether a particular line is an error message and extract file name, line number and error text, respectively. Error type (error/warning) is also guessed by matching error text with the '^[wW]arning' pattern. Anything that was not classified as a warning is considered an error. Type is then used to sort error menu items, which shows error messages first.

Flymake is also able to interpret error message patterns missing err-text-idx information. This is done by merely taking the rest of the matched line ((substring line (match-end 0))) as error text. This trick allows to make use of a huge collection of error message line patterns from compile.el. All these error patterns are appended to the end of flymake-err-line-patterns.

The error information obtained is saved in a buffer local variable. The buffer for which the process output belongs is determined from the process-id->buffer mapping updated after every process launch/exit.