History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: BOO-509
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Doug H
Reporter: Doug H
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Boo

Custom compiler error and warning messages

Created: 14/Oct/05 09:36 PM   Updated: 21/Oct/05 09:50 PM
Component/s: Compiler
Affects Version/s: 0.7
Fix Version/s: 0.7.5

Time Tracking:
Not Specified

File Attachments: 1. Text File customerror.patch (13 kb)

Issue Links:
dependent
 

Testcase included: yes


 Description  « Hide
This just adds blank templates for error and warning messages so we can throw our own (without having to use bce0044). This is useful for example in ast macros or attributes. You can add a compiler error instead of raising an exception.

For example:

Errors.Add(CompilerErrorFactory.CustomError(lexicalinfo, "Some custom error message"));
or
Errors.Add(CompilerErrorFactory.CustomError("your message"));
or
Errors.Add(new CompilerError("Some custom message"));

Warnings.Add(CompilerWarningFactory.CustomWarning(info, "Custom warning message"));
or
Warnings.Add(new CompilerWarning(info, "Custom message"));

The IDs used are BCE0000 and BCW0000.

Some of the "asserts" in boo.lang.useful could probably be changed to use InvalidNodeForAttribute or CustomError.
I made some of these changes to singletonattribute, onceattribute, and collectionattribute (the latter adds a call to customerror). tests\testcases\errors\bce0000-1.boo tests that customerror.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.