mono/mono-basic — pull request #3 by lee-m (2012-09-24 20:12:05+00:00)
Title: Implementation of additional errors/warnings

Hi,

The linked commits implement additional errors and warnings which are not currently handled by VBNC. Apologies for lumping these into a single pull request, I thought I'd be able to split the incoming changes into multiple pull requests for each logical change.

Briefly summarised the changes are:

* Tighten semantic checking for property declarations to catch cases of properties missing a Get/Set when one should be provided based on whether the property is ReadOnly/WriteOnly etc.
* Catch errors in trying to write the output to a location which doesn't exist or when attempting to overwrite a read-only file.
* Implement warning 42024 for unused local variables.

Some additional changes required for handling the output file writing errors are needed to match the output of VBC which doesn't report a source location in some instances. VBNC did have a mechanism of showing a message without a location, but this was limited to command line errors of the form "vbc : command line error BCXXXX : " whereas VBC outputs something like "vbc : error BCXXXX : " in some cases which wasn't yet supported.

Warning 42024 is implemented by tracking which local variables are referenced in a function. As each simple name is resolved to a local variable, a "referenced" flag is set on that variable declaration. After the entire function body has been resolved, a pass is made over all local variables to warn for those variables which were unused.

All of the above changes has been successfully regression tested with no new failures.

Cheers,
Lee