# TODO: Share the WarningAction between Compiler and CobraParser enum WarningActionEnum Print Throw class CobraWarning inherits SourceException # invariant not .isError var _fileName as String? var _lineNum as int? var _token as IToken? cue init(message as String?) .init(nil, nil, message) cue init(fileName as String, lineNum as int, message as String) base.init(message) _fileName, _lineNum = fileName, lineNum cue init(fileName as String?, token as IToken?, message as String) base.init(message) _fileName = fileName _token = token cue init(token as IToken, message as String) base.init(message) _token = token _message = message get isError as bool is override return false get hasSourceSite as bool is override return _token or _fileName get fileName as String is override return _fileName ? _token.fileName get lineNum as int is override if _lineNum, return _lineNum if _token, return _token.lineNum return 1 class DoNotUseException inherits SystemException """ Throw this exception from a property or method that a class dictates should not be used. Essentially, this is dis-inheritance. Use of this exception, however, should make one question the design of the class hierarchy. """ cue init(msg as String?) base.init(msg) pass cue init(msg as String?, innerExc as Exception?) base.init(msg, innerExc) pass