Skip to main content

DiagnosticCode

Enum DiagnosticCode 

Source
#[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

§

TagRefEnd = 11_999

§

SourceMap = 12_000

§

Unknown = 65_535

Implementations§

Source§

impl DiagnosticCode

Source

pub const fn from_repr(discriminant: u16) -> Option<DiagnosticCode>

Try to create Self from the raw representation

Source§

impl DiagnosticCode

Source

pub fn code(&self) -> u16

Source

pub fn from_code(code: u16) -> Option<Self>

Source

pub fn message(&self) -> &'static str

Source

pub fn level_str(&self) -> &'static str

Source

pub fn is_error(&self) -> bool

Source

pub fn is_warning(&self) -> bool

Source

pub fn is_info(&self) -> bool

Source

pub fn is_hint(&self) -> bool

Source

pub fn is_reference(&self) -> bool

Source

pub fn is_tag(&self) -> bool

Source

pub fn is_sourcemap(&self) -> bool

Trait Implementations§

Source§

impl Clone for DiagnosticCode

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for DiagnosticCode

Source§

impl Debug for DiagnosticCode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for DiagnosticCode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl EnumMessage for DiagnosticCode

Source§

fn get_message(&self) -> Option<&'static str>

Source§

fn get_detailed_message(&self) -> Option<&'static str>

Source§

fn get_documentation(&self) -> Option<&'static str>

Get the doc comment associated with a variant if it exists.
Source§

fn get_serializations(&self) -> &'static [&'static str]

Source§

impl<'_derivative_strum> From<&'_derivative_strum DiagnosticCode> for &'static str

Source§

fn from(x: &'_derivative_strum DiagnosticCode) -> &'static str

Converts to this type from the input type.
Source§

impl From<DiagnosticCode> for &'static str

Source§

fn from(x: DiagnosticCode) -> &'static str

Converts to this type from the input type.
Source§

impl From<DiagnosticCode> for u16

Source§

fn from(val: DiagnosticCode) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for DiagnosticCode

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialOrd for DiagnosticCode

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StructuralPartialEq for DiagnosticCode

Source§

impl TryFrom<u16> for DiagnosticCode

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: u16) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.