Mercurial > projects > dang
view src/basic/Messages.d @ 207:e0551773a005
Added the correct version.
author | Anders Johnsen <skabet@gmail.com> |
---|---|
date | Tue, 12 Aug 2008 18:19:34 +0200 |
parents | d3c148ca429b |
children |
line wrap: on
line source
module basic.Messages; enum : uint { // Lex InvalidSymbol, InvalidIlligaleType, UnexpectedEOFBlock, OnlyOneDotFloating, OnlyOneEFloating, // Parse UnexpectedTokMulti, UnexpectedTokSingle, UnexpectedTok, CaseValueMustBeInt, UnexpectedBeginStmt, UnexpectedTokType, ExpectedIdAfterDot, ExpectedExp, ExpectedCastType, InvalidDeclType, InvalidType, UnexpectedLinkType, // - imports/module ExpectedIdAfterPackage, RenameMustBeSingleIdent, UnexpectedEOF, // sema CannotFindModule, InvalidImplicitCast, UndefinedIdentifier, UndefinedType, MissingMember, CannotRedeclare, // - switch MultipleDefaults, OverlappingCases, InvalidCaseValue, NoConstructor, NoMachingCon, CandidateNr, NoMethodByName, NoMachingMethod, CannotReassignSArray, CanOnlyDerefPointers, CannotCallMethod, // Strings InvalidStrPrefix, InvalidStrEscape, InvalidUtf8Hex, InvalidHexStrChar, InvalidCharEntity, NoCharEntityEnd, StringShortEscape, StringHexInvalid, InvalidStartInteger, IntegerToLarge, FloatingToLarge, FloatingInvalidEnd, FloatingBadLocation, FloatingDotInE, // Protection CannotAccessPrivate, } enum MessageType { Warning, Error, } MessageEntry[uint] Messages; struct MessageEntry { MessageType type; char[] message; } private alias MessageType.Error Err; private alias MessageType.Warning War; private alias MessageEntry E; static this() { Messages = [ // lexing UnexpectedEOFBlock : E(Err, "Unexpected end of file. Unclosed comment block"), InvalidSymbol : E(Err, "Read invalid symbol: '%0'"), OnlyOneDotFloating : E(Err, "Only one '.' is allowed in an floating number"), OnlyOneEFloating : E(Err, "Only one E is allowed in an floating number"), // parsing UnexpectedTokMulti : E(Err, "Unexpected token, got %0 expected one of %1"), UnexpectedTokSingle : E(Err, "Unexpected token, got %0 expected %1"), UnexpectedTok : E(Err, "Unexpected token %0"), CaseValueMustBeInt : E(Err, "Cases can only be integer literals"), UnexpectedBeginStmt : E(Err, "Unexpected begining of statement."), UnexpectedTokType : E(Err, "Unexpected token in Type parsing. Got %0"), ExpectedIdAfterDot : E(Err, "Expected identifier after '.'"), ExpectedExp : E(Err, "Expected expression"), ExpectedCastType : E(Err, "Expected cast type"), InvalidDeclType : E(Err, "Invalid declaration type"), InvalidType : E(Err, "Invalid type"), ExpectedIdAfterPackage : E(Err, "Identifier expected following package"), UnexpectedLinkType : E(Err, "Invalid linkage type. Only C, C++, D, Windows, Pascal and System is allowed"), UnexpectedEOF : E(Err, "Unexpected EOF after '%0'"), // sema CannotFindModule : E(Err, "Cannot find module '%0'"), InvalidImplicitCast : E(Err, "Cannot make implicit cast between '%0' and '%1'"), UndefinedIdentifier : E(Err, "Undefined identifier '%0'"), UndefinedType : E(Err, "Undefined type '%0'"), MissingMember : E(Err, "%0 %1 has no member %2"), CannotRedeclare : E(Err, "Cannot redeclare '%0'"), NoConstructor : E(Err, "No constructor avaible"), NoMachingCon : E(Err, "No maching constructor. Candidates are:"), CandidateNr : E(Err, "Candidate number %0"), NoMethodByName : E(Err, "No method with that name"), NoMachingMethod : E(Err, "No maching method. Candidates are:"), // - switch MultipleDefaults : E(Err, "Switch statements can't have multiple defaults"), OverlappingCases : E(Err, "Can't have multiple cases with the same value." " Values appearing in multiple cases: %0"), InvalidCaseValue : E(Err, "Case values must be integers"), CannotReassignSArray: E(Err, "Cannot reassign static arrays"), CanOnlyDerefPointers: E(Err, "Can only deref pointers, not '%0'"), CannotCallMethod : E(Err, "Cannot call a method of type '%0' with '%1'"), // literals InvalidStrPrefix : E(Err, "Invalid string literal prefix"), InvalidStrEscape : E(Err, "Invalid escape sequence"), InvalidUtf8Hex : E(Err, "Invalid Utf8 hex char"), NoCharEntityEnd : E(Err, "Character entity have no end, insert ';'"), InvalidCharEntity : E(Err, "Invalid character entity"), InvalidHexStrChar : E(Err, "Invalid character in hex string"), StringShortEscape : E(Err, "String literal is to short for escape sequence"), StringHexInvalid : E(Err, "Hex escape sequence have invalid digit at position %0 of %1"), InvalidStartInteger : E(Err, "Invalid begining of number"), IntegerToLarge : E(Err, "Integer is to large. Max size is 18446744073709551615"), FloatingToLarge : E(Err, "Floating literal is to large"), FloatingInvalidEnd : E(Err, "Floating literal have wrong ending"), FloatingBadLocation : E(Err, "Bad location for '%0' in floting literal"), FloatingDotInE : E(Err, "There cannot be a dot in the exponent of a floating literal"), CannotAccessPrivate : E(Err, "Cannot access private member.") ]; }