Skip to content

Draft: Remove 'syntax error, ' and internalise ParseError

Al Thomas requested to merge astavale/vala:remove-syntax-error into master

Both the Vala and Genie parsers can throw a ParseError. At present this is caught and has the phrase 'syntax error, ' placed in front of the exception message. This makes it more difficult for translations because the message is now split. It also seems superfluous. For example missing the semi-colon at the end of a line gives error: syntax error, expected `;'. Well we know it is an error and the word 'syntax' doesn't add much. So this patch will make the message just error: expected `;' If that is too brief then the individual message should be updated, but that is part of a wider review.

Some code that causes syntax error, to be reported twice to the programmer has also been removed.

ParseError has a FAILED value. This is unused and so removed in the second patch. Given this changes the public API ParseError has also been made internal. The second patch is a bit more controversial, but would help understand how third parties use libvala for checking source files and reporting diagnostics.

Edited by Rico Tzschichholz

Merge request reports