#[repr(u16)]pub enum DiagnosticCode {
Show 181 variants
ErrorStart = 1_000,
InternalError = 1001,
LexerError = 1002,
ParserError = 1003,
EmitterError = 1004,
OptimizerError = 1005,
Unimplemented = 1006,
UnknownToken = 1007,
UnexpectedToken = 1008,
InvalidReservedKeyword = 1009,
InvalidKeyword = 1010,
InvalidNumberLiteralUnderscore = 1011,
InvalidNumberLiteral = 1012,
OverflowNumberLiteral = 1013,
OverflowIntegerLiteral = 1014,
InvalidOrdinalLiteral = 1015,
UnterminatedString = 1016,
InvalidEscapeSequence = 1017,
InvalidHexEscapeSequence = 1018,
InvalidUnicodeEscapeSequence = 1019,
BadArraySpread = 1020,
UnterminatedInterpolation = 1021,
BadInterpolation = 1022,
EmptyInterpolation = 1023,
UnexpectedUnderscore = 1024,
UnexpectedGlobal = 1025,
MissingComma = 1026,
MissingCloseBracket = 1027,
MissingOpenBrace = 1028,
MissingCloseBrace = 1029,
MissingCloseParen = 1030,
MissingSemicolon = 1031,
MissingColon = 1032,
MissingBindOperator = 1033,
InvalidConstantName = 1034,
MissingFunctionName = 1035,
MissingModuleName = 1036,
MissingOpenParenAfterExtension = 1037,
MissingOpenParenAfterType = 1038,
InvalidTypeCall = 1039,
RecordLiteralInExtensionCaller = 1040,
MissingCase = 1041,
UnknownExpression = 1042,
UnmatchedCloseBrace = 1043,
UnmatchedCloseBracket = 1044,
UnmatchedCloseParen = 1045,
UnknownPattern = 1046,
InvalidConstantLiteral = 1047,
UnknownStatement = 1048,
ExpressionExpected = 1049,
PatternExpected = 1050,
ExclamationInLiteralPattern = 1051,
MutInRebindPattern = 1052,
ConstantInBindPattern = 1053,
MutInDiscardPattern = 1054,
DiscardInSpreadPattern = 1055,
MispositionedSpreadInRecordPattern = 1056,
InterpolatedNameRecordPattern = 1057,
BadOmitKeyRecordPattern = 1058,
AmbiguousRangePattern = 1059,
DuplicateSpreadPattern = 1060,
MispositionedRestParameter = 1061,
UndefinedVariableAssignment = 1062,
ImmutableVariableAssignment = 1063,
UninitializedVariable = 1064,
DuplicateVariableDeclaration = 1065,
UnexpectedBreak = 1066,
UnexpectedContinue = 1067,
MisuseOfGlobalKeyword = 1068,
BadOmitKeyRecordExpression = 1069,
UnassignableExpression = 1070,
UnexpectedPub = 1071,
ErrorEnd = 1_999,
WarningStart = 2_000,
MisleadingNilVariable = 2001,
UnnecessaryIrrefutablePattern = 2002,
MatchExpressionHasNoCases = 2003,
NonNumberInRange = 2004,
NonNumberOrStringInComparison = 2005,
NonNumberInArithmetic = 2006,
NonBooleanInLogical = 2007,
NonCompoundIn = 2008,
LiteralNotCallable = 2009,
LiteralNotIndexable = 2010,
GlobalVariableNotDeclared = 2011,
WarningEnd = 2_999,
InfoStart = 3_000,
InfoEnd = 3_999,
HintStart = 4_000,
UnusedLocalVariable = 4001,
UnusedLocalFunction = 4002,
PreferLogicalOperatorAnd = 4003,
PreferLogicalOperatorOr = 4004,
PreferLogicalOperatorNot = 4005,
PreferParenthesesForRecordLiteral = 4006,
PreferIfExpression = 4007,
UnnecessaryParentheses = 4008,
PreferUppercaseConstant = 4009,
UnreachableCode = 4010,
HintEnd = 4_999,
ReferenceStart = 5_000,
VariableDeclaredHere = 5001,
FunctionDeclaredHere = 5002,
ParameterDeclaredHere = 5003,
ParameterItDeclaredHere = 5004,
ParameterRestDeclaredHere = 5005,
ParameterSubPatternDeclaredHere = 5006,
ReferenceEnd = 5_999,
TagStart = 10_000,
LocalConst = 10001,
LocalImmutable = 10002,
LocalMutable = 10003,
LocalFunction = 10004,
LocalModule = 10005,
ParameterIt = 10006,
ParameterImmutable = 10007,
ParameterMutable = 10008,
ParameterImmutableRest = 10009,
ParameterMutableRest = 10010,
ParameterPattern = 10011,
ParameterRestPattern = 10012,
ParameterSubPatternImmutable = 10013,
ParameterSubPatternMutable = 10014,
GlobalVariable = 10015,
GlobalDynamicAccess = 10016,
RecordFieldIdName = 10017,
RecordFieldOrdinalName = 10018,
RecordFieldStringName = 10019,
UnnamedRecordField0 = 10020,
UnnamedRecordField1 = 10021,
UnnamedRecordField2 = 10022,
UnnamedRecordField3 = 10023,
UnnamedRecordField4 = 10024,
UnnamedRecordField5 = 10025,
UnnamedRecordField6 = 10026,
UnnamedRecordField7 = 10027,
UnnamedRecordField8 = 10028,
UnnamedRecordField9 = 10029,
UnnamedRecordFieldN = 10030,
OmitNamedRecordField = 10031,
FunctionCall = 10032,
ExtensionCall = 10033,
Scope = 10034,
String = 10035,
Interpolation = 10036,
ForExpression = 10037,
WhileExpression = 10038,
LoopExpression = 10039,
FnDeclaration = 10040,
FnExpression = 10041,
IfExpression = 10042,
MatchExpression = 10043,
TagEnd = 10_999,
TagRefStart = 11_000,
ReadLocal = 11001,
ReadWriteLocal = 11002,
WriteLocal = 11003,
RedeclareLocal = 11004,
ExportedLocal = 11005,
Callable = 11006,
ArgumentExtension = 11007,
ArgumentStart = 11008,
ArgumentEnd = 11009,
ArgumentComma = 11010,
ArgumentSpread = 11011,
KeywordFor = 11012,
KeywordIn = 11013,
KeywordWhile = 11014,
KeywordLoop = 11015,
KeywordBreak = 11016,
KeywordContinue = 11017,
KeywordIf = 11018,
KeywordElse = 11019,
KeywordMatch = 11020,
KeywordCase = 11021,
KeywordFn = 11022,
KeywordReturn = 11023,
OmitNamedRecordFieldName = 11024,
TagRefEnd = 11_999,
SourceMap = 12_000,
Unknown = 65_535,
}Expand description
Diagnostic codes for MiraScript compiler and tools.
Variants§
ErrorStart = 1_000
InternalError = 1001
LexerError = 1002
ParserError = 1003
EmitterError = 1004
OptimizerError = 1005
Unimplemented = 1006
UnknownToken = 1007
UnexpectedToken = 1008
InvalidReservedKeyword = 1009
InvalidKeyword = 1010
InvalidNumberLiteralUnderscore = 1011
InvalidNumberLiteral = 1012
OverflowNumberLiteral = 1013
OverflowIntegerLiteral = 1014
InvalidOrdinalLiteral = 1015
UnterminatedString = 1016
InvalidEscapeSequence = 1017
InvalidHexEscapeSequence = 1018
InvalidUnicodeEscapeSequence = 1019
BadArraySpread = 1020
UnterminatedInterpolation = 1021
BadInterpolation = 1022
EmptyInterpolation = 1023
UnexpectedUnderscore = 1024
UnexpectedGlobal = 1025
MissingComma = 1026
MissingCloseBracket = 1027
MissingOpenBrace = 1028
MissingCloseBrace = 1029
MissingCloseParen = 1030
MissingSemicolon = 1031
MissingColon = 1032
MissingBindOperator = 1033
InvalidConstantName = 1034
MissingFunctionName = 1035
MissingModuleName = 1036
MissingOpenParenAfterExtension = 1037
MissingOpenParenAfterType = 1038
InvalidTypeCall = 1039
RecordLiteralInExtensionCaller = 1040
MissingCase = 1041
UnknownExpression = 1042
UnmatchedCloseBrace = 1043
UnmatchedCloseBracket = 1044
UnmatchedCloseParen = 1045
UnknownPattern = 1046
InvalidConstantLiteral = 1047
UnknownStatement = 1048
ExpressionExpected = 1049
PatternExpected = 1050
ExclamationInLiteralPattern = 1051
MutInRebindPattern = 1052
ConstantInBindPattern = 1053
MutInDiscardPattern = 1054
DiscardInSpreadPattern = 1055
MispositionedSpreadInRecordPattern = 1056
InterpolatedNameRecordPattern = 1057
BadOmitKeyRecordPattern = 1058
AmbiguousRangePattern = 1059
DuplicateSpreadPattern = 1060
MispositionedRestParameter = 1061
UndefinedVariableAssignment = 1062
ImmutableVariableAssignment = 1063
UninitializedVariable = 1064
DuplicateVariableDeclaration = 1065
UnexpectedBreak = 1066
UnexpectedContinue = 1067
MisuseOfGlobalKeyword = 1068
BadOmitKeyRecordExpression = 1069
UnassignableExpression = 1070
UnexpectedPub = 1071
ErrorEnd = 1_999
WarningStart = 2_000
MisleadingNilVariable = 2001
UnnecessaryIrrefutablePattern = 2002
MatchExpressionHasNoCases = 2003
NonNumberInRange = 2004
NonNumberOrStringInComparison = 2005
NonNumberInArithmetic = 2006
NonBooleanInLogical = 2007
NonCompoundIn = 2008
LiteralNotCallable = 2009
LiteralNotIndexable = 2010
GlobalVariableNotDeclared = 2011
WarningEnd = 2_999
InfoStart = 3_000
InfoEnd = 3_999
HintStart = 4_000
UnusedLocalVariable = 4001
UnusedLocalFunction = 4002
PreferLogicalOperatorAnd = 4003
PreferLogicalOperatorOr = 4004
PreferLogicalOperatorNot = 4005
PreferParenthesesForRecordLiteral = 4006
PreferIfExpression = 4007
UnnecessaryParentheses = 4008
PreferUppercaseConstant = 4009
UnreachableCode = 4010
HintEnd = 4_999
ReferenceStart = 5_000
VariableDeclaredHere = 5001
FunctionDeclaredHere = 5002
ParameterDeclaredHere = 5003
ParameterItDeclaredHere = 5004
ParameterRestDeclaredHere = 5005
ParameterSubPatternDeclaredHere = 5006
ReferenceEnd = 5_999
TagStart = 10_000
LocalConst = 10001
LocalImmutable = 10002
LocalMutable = 10003
LocalFunction = 10004
LocalModule = 10005
ParameterIt = 10006
ParameterImmutable = 10007
ParameterMutable = 10008
ParameterImmutableRest = 10009
ParameterMutableRest = 10010
ParameterPattern = 10011
ParameterRestPattern = 10012
ParameterSubPatternImmutable = 10013
ParameterSubPatternMutable = 10014
GlobalVariable = 10015
GlobalDynamicAccess = 10016
RecordFieldIdName = 10017
RecordFieldOrdinalName = 10018
RecordFieldStringName = 10019
UnnamedRecordField0 = 10020
UnnamedRecordField1 = 10021
UnnamedRecordField2 = 10022
UnnamedRecordField3 = 10023
UnnamedRecordField4 = 10024
UnnamedRecordField5 = 10025
UnnamedRecordField6 = 10026
UnnamedRecordField7 = 10027
UnnamedRecordField8 = 10028
UnnamedRecordField9 = 10029
UnnamedRecordFieldN = 10030
OmitNamedRecordField = 10031
FunctionCall = 10032
ExtensionCall = 10033
Scope = 10034
String = 10035
Interpolation = 10036
ForExpression = 10037
WhileExpression = 10038
LoopExpression = 10039
FnDeclaration = 10040
FnExpression = 10041
IfExpression = 10042
MatchExpression = 10043
TagEnd = 10_999
TagRefStart = 11_000
ReadLocal = 11001
ReadWriteLocal = 11002
WriteLocal = 11003
RedeclareLocal = 11004
ExportedLocal = 11005
Callable = 11006
ArgumentExtension = 11007
ArgumentStart = 11008
ArgumentEnd = 11009
ArgumentComma = 11010
ArgumentSpread = 11011
KeywordFor = 11012
KeywordIn = 11013
KeywordWhile = 11014
KeywordLoop = 11015
KeywordBreak = 11016
KeywordContinue = 11017
KeywordIf = 11018
KeywordElse = 11019
KeywordMatch = 11020
KeywordCase = 11021
KeywordFn = 11022
KeywordReturn = 11023
OmitNamedRecordFieldName = 11024
Work with DiagnosticCode::OmitNamedRecordField
TagRefEnd = 11_999
SourceMap = 12_000
Unknown = 65_535
Implementations§
Source§impl DiagnosticCode
impl DiagnosticCode
pub fn code(&self) -> u16
pub fn from_code(code: u16) -> Option<Self>
pub fn message(&self) -> &'static str
pub fn level_str(&self) -> &'static str
pub fn is_error(&self) -> bool
pub fn is_warning(&self) -> bool
pub fn is_info(&self) -> bool
pub fn is_hint(&self) -> bool
pub fn is_reference(&self) -> bool
pub fn is_tag(&self) -> bool
pub fn is_sourcemap(&self) -> bool
Trait Implementations§
Source§impl Clone for DiagnosticCode
impl Clone for DiagnosticCode
impl Copy for DiagnosticCode
Source§impl Debug for DiagnosticCode
impl Debug for DiagnosticCode
Source§impl Display for DiagnosticCode
impl Display for DiagnosticCode
Source§impl EnumMessage for DiagnosticCode
impl EnumMessage for DiagnosticCode
fn get_message(&self) -> Option<&'static str>
fn get_detailed_message(&self) -> Option<&'static str>
Source§fn get_documentation(&self) -> Option<&'static str>
fn get_documentation(&self) -> Option<&'static str>
Get the doc comment associated with a variant if it exists.
fn get_serializations(&self) -> &'static [&'static str]
Source§impl<'_derivative_strum> From<&'_derivative_strum DiagnosticCode> for &'static str
impl<'_derivative_strum> From<&'_derivative_strum DiagnosticCode> for &'static str
Source§fn from(x: &'_derivative_strum DiagnosticCode) -> &'static str
fn from(x: &'_derivative_strum DiagnosticCode) -> &'static str
Converts to this type from the input type.
Source§impl From<DiagnosticCode> for &'static str
impl From<DiagnosticCode> for &'static str
Source§fn from(x: DiagnosticCode) -> &'static str
fn from(x: DiagnosticCode) -> &'static str
Converts to this type from the input type.
Source§impl From<DiagnosticCode> for u16
impl From<DiagnosticCode> for u16
Source§fn from(val: DiagnosticCode) -> Self
fn from(val: DiagnosticCode) -> Self
Converts to this type from the input type.
Source§impl PartialEq for DiagnosticCode
impl PartialEq for DiagnosticCode
Source§impl PartialOrd for DiagnosticCode
impl PartialOrd for DiagnosticCode
impl StructuralPartialEq for DiagnosticCode
Auto Trait Implementations§
impl Freeze for DiagnosticCode
impl RefUnwindSafe for DiagnosticCode
impl Send for DiagnosticCode
impl Sync for DiagnosticCode
impl Unpin for DiagnosticCode
impl UnsafeUnpin for DiagnosticCode
impl UnwindSafe for DiagnosticCode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more