Skip to main content

CompilerErrorCode

Enum CompilerErrorCode 

Source
#[repr(i32)]
pub enum CompilerErrorCode {
Show 119 variants UnexpectedCharacter = -560, FatalCompilerError = -561, ProgramCompoundStatementAtStart = -562, UnexpectedEndCompoundStatement = -563, AfterCompoundStatementAtEnd = -564, ParsingVariableList = -565, UnknownStateInCompiler = -566, InvalidDeclarationType = -567, NoLeftBracketOnExpression = -568, NoRightBracketOnExpression = -569, BadStartOfStatement = -570, NoLeftBracketOnArgList = -571, NoRightBracketOnArgList = -572, NoSemicolonAfterExpression = -573, ParsingAssignmentStatement = -574, BadLValue = -575, BadConstantType = -576, IdentifierListFull = -577, NonIntegerIdForIntegerConstant = -578, NonFloatIdForFloatConstant = -579, NonStringIdForStringConstant = -580, VariableAlreadyUsedWithinScope = -581, VariableDefinedWithoutType = -582, IncorrectVariableStateLeftOnStack = -583, NonIntegerExpressionWhereIntegerRequired = -584, VoidExpressionWhereNonVoidRequired = -585, InvalidParametersForAssignment = -586, DeclarationDoesNotMatchParameters = -587, LogicalOperationHasInvalidOperands = -588, EqualityTestHasInvalidOperands = -589, ComparisonTestHasInvalidOperands = -590, ShiftOperationHasInvalidOperands = -591, ArithmeticOperationHasInvalidOperands = -592, UnknownOperationInSemanticCheck = -593, ScriptTooLarge = -594, ReturnStatementHasNoParameters = -595, NoWhileAfterDoKeyword = -596, FunctionDefinitionMissingName = -597, FunctionDefinitionMissingParameterList = -598, MalformedParameterList = -599, BadTypeSpecifier = -600, NoSemicolonAfterStructure = -601, EllipsisInIdentifier = -602, FileNotFound = -603, IncludeRecursive = -604, IncludeTooManyLevels = -605, ParsingReturnStatement = -606, ParsingIdentifierList = -607, ParsingFunctionDeclaration = -608, DuplicateFunctionImplementation = -609, TokenTooLong = -610, UndefinedStructure = -611, LeftOfStructurePartNotStructure = -612, RightOfStructurePartNotFieldInStructure = -613, UndefinedFieldInStructure = -614, StructureRedefined = -615, VariableUsedTwiceInSameStructure = -616, FunctionImplementationAndDefinitionDiffer = -617, MismatchedTypes = -618, IntegerNotAtTopOfStack = -619, ReturnTypeAndFunctionTypeMismatched = -620, NotAllControlPathsReturnAValue = -621, UndefinedIdentifier = -622, NoFunctionMainInScript = -623, FunctionMainMustHaveVoidReturnValue = -624, FunctionMainMustHaveNoParameters = -625, NonVoidFunctionCannotBeAStatement = -626, BadVariableName = -627, NonOptionalParameterCannotFollowOptionalParameter = -628, TypeDoesNotHaveAnOptionalParameter = -629, NonConstantInFunctionDeclaration = -630, ParsingConstantVector = -631, OperandMustBeAnIntegerLValue = -1_594, ConditionalRequiresSecondExpression = -1_595, ConditionalMustHaveMatchingReturnTypes = -1_596, MultipleDefaultStatementsWithinSwitch = -1_597, MultipleCaseConstantStatementsWithinSwitch = -1_598, CaseParameterNotAConstantInteger = -1_599, SwitchMustEvaluateToAnInteger = -1_600, NoColonAfterDefaultLabel = -1_601, NoColonAfterCaseLabel = -1_602, NoSemicolonAfterStatement = -1_603, BreakOutsideOfLoopOrCaseStatement = -4_834, TooManyParametersOnFunction = -4_835, UnableToOpenFileForWriting = -4_836, UnterminatedStringConstant = -4_855, NoFunctionIntscInScript = -5_182, FunctionIntscMustHaveVoidReturnValue = -5_183, FunctionIntscMustHaveNoParameters = -5_184, JumpingOverDeclarationStatementsCaseDisallowed = -6_804, JumpingOverDeclarationStatementsDefaultDisallowed = -6_805, ElseWithoutCorrespondingIf = -6_823, IfConditionCannotBeFollowedByANullStatement = -10_407, InvalidTypeForConstKeyword = -3_741, ConstKeywordCannotBeUsedOnNonGlobalVariables = -3_742, InvalidValueAssignedToConstant = -3_752, SwitchConditionCannotBeFollowedByANullStatement = -9_081, WhileConditionCannotBeFollowedByANullStatement = -9_082, ForStatementCannotBeFollowedByANullStatement = -9_083, CannotIncludeThisFileTwice = -9_155, ElseCannotBeFollowedByANullStatement = -40_104, VmTooManyInstructions = -632, VmTooManyLevelsOfRecursion = -633, VmFileNotOpened = -634, VmFileNotCompiledSuccessfully = -635, VmInvalidAuxCode = -636, VmNullVirtualMachineNode = -637, VmStackOverflow = -638, VmStackUnderflow = -639, VmInvalidOpCode = -640, VmInvalidExtraDataOnOpCode = -641, VmInvalidCommand = -642, VmFakeShortcutLogicalOperation = -643, VmDivideByZero = -644, VmFakeAbortScript = -645, VmIpOutOfCodeSegment = -646, VmCommandImplementerNotSet = -647, VmUnknownTypeOnRunTimeStack = -648, AlreadyPrinted = -1,
}
Expand description

Stable compiler and VM error codes used by the upstream NWScript compiler.

Variants§

§

UnexpectedCharacter = -560

An unexpected character was encountered during lexing.

§

FatalCompilerError = -561

The compiler reported a fatal internal error.

§

ProgramCompoundStatementAtStart = -562

Parsing expected a compound statement at program start.

§

UnexpectedEndCompoundStatement = -563

A closing brace appeared without a matching opening brace.

§

AfterCompoundStatementAtEnd = -564

Unexpected tokens appeared after a compound statement.

§

ParsingVariableList = -565

Parsing a variable list failed.

§

UnknownStateInCompiler = -566

The compiler entered an unexpected internal state.

§

InvalidDeclarationType = -567

A declaration used an invalid type.

§

NoLeftBracketOnExpression = -568

An expression was missing (.

§

NoRightBracketOnExpression = -569

An expression was missing ).

§

BadStartOfStatement = -570

A statement started with an invalid token.

§

NoLeftBracketOnArgList = -571

A call argument list was missing (.

§

NoRightBracketOnArgList = -572

A call argument list was missing ).

§

NoSemicolonAfterExpression = -573

An expression statement was missing a semicolon.

§

ParsingAssignmentStatement = -574

Parsing an assignment statement failed.

§

BadLValue = -575

The assignment target was invalid.

§

BadConstantType = -576

A constant literal had an invalid type.

§

IdentifierListFull = -577

The identifier table is full.

§

NonIntegerIdForIntegerConstant = -578

An integer constant referenced a non-integer identifier.

§

NonFloatIdForFloatConstant = -579

A float constant referenced a non-float identifier.

§

NonStringIdForStringConstant = -580

A string constant referenced a non-string identifier.

§

VariableAlreadyUsedWithinScope = -581

A variable name was reused within the same scope.

§

VariableDefinedWithoutType = -582

A variable was defined without a type.

§

IncorrectVariableStateLeftOnStack = -583

The compile stack ended in an invalid variable state.

§

NonIntegerExpressionWhereIntegerRequired = -584

An integer expression was required.

§

VoidExpressionWhereNonVoidRequired = -585

A non-void expression was required.

§

InvalidParametersForAssignment = -586

Assignment parameters were invalid.

§

DeclarationDoesNotMatchParameters = -587

A declaration did not match its parameter list.

§

LogicalOperationHasInvalidOperands = -588

A logical operation used invalid operands.

§

EqualityTestHasInvalidOperands = -589

An equality test used invalid operands.

§

ComparisonTestHasInvalidOperands = -590

A comparison test used invalid operands.

§

ShiftOperationHasInvalidOperands = -591

A shift operation used invalid operands.

§

ArithmeticOperationHasInvalidOperands = -592

An arithmetic operation used invalid operands.

§

UnknownOperationInSemanticCheck = -593

The semantic checker saw an unknown operation.

§

ScriptTooLarge = -594

The compiled script exceeded the maximum supported size.

§

ReturnStatementHasNoParameters = -595

A return statement was missing its return value.

§

NoWhileAfterDoKeyword = -596

do was not followed by while.

§

FunctionDefinitionMissingName = -597

A function definition was missing its name.

§

FunctionDefinitionMissingParameterList = -598

A function definition was missing its parameter list.

§

MalformedParameterList = -599

A parameter list was malformed.

§

BadTypeSpecifier = -600

A type specifier was invalid.

§

NoSemicolonAfterStructure = -601

A struct declaration was missing a semicolon.

§

EllipsisInIdentifier = -602

An ellipsis-like construct appeared in an identifier.

§

FileNotFound = -603

A requested source file could not be found.

§

IncludeRecursive = -604

A recursive include was detected.

§

IncludeTooManyLevels = -605

Too many include levels were used.

§

ParsingReturnStatement = -606

Parsing a return statement failed.

§

ParsingIdentifierList = -607

Parsing the identifier list failed.

§

ParsingFunctionDeclaration = -608

Parsing a function declaration failed.

§

DuplicateFunctionImplementation = -609

A function implementation was defined more than once.

§

TokenTooLong = -610

A token exceeded the maximum allowed length.

§

UndefinedStructure = -611

A referenced struct type was undefined.

§

LeftOfStructurePartNotStructure = -612

The left side of a field access was not a structure.

§

RightOfStructurePartNotFieldInStructure = -613

The right side of a field access was not a valid field.

§

UndefinedFieldInStructure = -614

A referenced struct field was undefined.

§

StructureRedefined = -615

A struct was redefined.

§

VariableUsedTwiceInSameStructure = -616

A field name was reused within the same structure.

§

FunctionImplementationAndDefinitionDiffer = -617

A function implementation disagreed with its declaration.

§

MismatchedTypes = -618

Two types were incompatible.

§

IntegerNotAtTopOfStack = -619

The top of stack was not an integer when required.

§

ReturnTypeAndFunctionTypeMismatched = -620

A function return type and returned expression type disagreed.

§

NotAllControlPathsReturnAValue = -621

Not all control paths return a value.

§

UndefinedIdentifier = -622

An identifier was undefined.

§

NoFunctionMainInScript = -623

The script did not define main.

§

FunctionMainMustHaveVoidReturnValue = -624

main must return void.

§

FunctionMainMustHaveNoParameters = -625

main must not take parameters.

§

NonVoidFunctionCannotBeAStatement = -626

A non-void function call was used as a statement.

§

BadVariableName = -627

A variable name was invalid.

§

NonOptionalParameterCannotFollowOptionalParameter = -628

A required parameter followed an optional one.

§

TypeDoesNotHaveAnOptionalParameter = -629

A type does not support optional parameters.

§

NonConstantInFunctionDeclaration = -630

A function declaration used a non-constant default value.

§

ParsingConstantVector = -631

Parsing a constant vector failed.

§

OperandMustBeAnIntegerLValue = -1_594

An operand needed to be an integer lvalue.

§

ConditionalRequiresSecondExpression = -1_595

A conditional expression was missing its second expression.

§

ConditionalMustHaveMatchingReturnTypes = -1_596

Both arms of a conditional expression must agree on type.

§

MultipleDefaultStatementsWithinSwitch = -1_597

Multiple default labels appeared in one switch.

§

MultipleCaseConstantStatementsWithinSwitch = -1_598

The same case value appeared more than once in one switch.

§

CaseParameterNotAConstantInteger = -1_599

A case value was not a constant integer.

§

SwitchMustEvaluateToAnInteger = -1_600

A switch expression must evaluate to an integer.

§

NoColonAfterDefaultLabel = -1_601

A default label was missing its colon.

§

NoColonAfterCaseLabel = -1_602

A case label was missing its colon.

§

NoSemicolonAfterStatement = -1_603

A statement was missing its semicolon.

§

BreakOutsideOfLoopOrCaseStatement = -4_834

break was used outside a loop or switch case.

§

TooManyParametersOnFunction = -4_835

A function exceeded the maximum number of parameters.

§

UnableToOpenFileForWriting = -4_836

An output file could not be written.

§

UnterminatedStringConstant = -4_855

A string literal was unterminated.

§

NoFunctionIntscInScript = -5_182

The script did not define the conditional entry function.

§

FunctionIntscMustHaveVoidReturnValue = -5_183

The conditional entry function must return void.

§

FunctionIntscMustHaveNoParameters = -5_184

The conditional entry function must not take parameters.

§

JumpingOverDeclarationStatementsCaseDisallowed = -6_804

A case jump would cross declarations illegally.

§

JumpingOverDeclarationStatementsDefaultDisallowed = -6_805

A default jump would cross declarations illegally.

§

ElseWithoutCorrespondingIf = -6_823

else appeared without a matching if.

§

IfConditionCannotBeFollowedByANullStatement = -10_407

An if condition cannot be followed by an empty statement.

§

InvalidTypeForConstKeyword = -3_741

const was used with an invalid type.

§

ConstKeywordCannotBeUsedOnNonGlobalVariables = -3_742

const cannot be used on non-global variables.

§

InvalidValueAssignedToConstant = -3_752

A constant declaration used an invalid assigned value.

§

SwitchConditionCannotBeFollowedByANullStatement = -9_081

A switch condition cannot be followed by an empty statement.

§

WhileConditionCannotBeFollowedByANullStatement = -9_082

A while condition cannot be followed by an empty statement.

§

ForStatementCannotBeFollowedByANullStatement = -9_083

A for statement cannot be followed by an empty statement.

§

CannotIncludeThisFileTwice = -9_155

The same file cannot be included twice.

§

ElseCannotBeFollowedByANullStatement = -40_104

else cannot be followed by an empty statement.

§

VmTooManyInstructions = -632

The VM exceeded its instruction limit.

§

VmTooManyLevelsOfRecursion = -633

The VM exceeded its recursion limit.

§

VmFileNotOpened = -634

The VM could not open a script file.

§

VmFileNotCompiledSuccessfully = -635

The VM was asked to run an uncompiled file.

§

VmInvalidAuxCode = -636

The VM encountered an invalid aux code.

§

VmNullVirtualMachineNode = -637

The VM encountered a null node.

§

VmStackOverflow = -638

The VM stack overflowed.

§

VmStackUnderflow = -639

The VM stack underflowed.

§

VmInvalidOpCode = -640

The VM encountered an invalid opcode.

§

VmInvalidExtraDataOnOpCode = -641

The VM encountered invalid extra data for an opcode.

§

VmInvalidCommand = -642

The VM encountered an invalid command id.

§

VmFakeShortcutLogicalOperation = -643

The VM hit a fake shortcut logical operation.

§

VmDivideByZero = -644

The VM attempted division by zero.

§

VmFakeAbortScript = -645

The VM received a fake abort request.

§

VmIpOutOfCodeSegment = -646

The VM instruction pointer left the code segment.

§

VmCommandImplementerNotSet = -647

The VM command implementer was not configured.

§

VmUnknownTypeOnRunTimeStack = -648

The VM encountered an unknown stack value type.

§

AlreadyPrinted = -1

The underlying error has already been emitted.

Implementations§

Source§

impl CompilerErrorCode

Source

pub fn code(self) -> i32

Returns the stable integer code used in diagnostics and fixtures.

Trait Implementations§

Source§

impl Clone for CompilerErrorCode

Source§

fn clone(&self) -> CompilerErrorCode

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for CompilerErrorCode

Source§

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

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

impl<'de> Deserialize<'de> for CompilerErrorCode

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Hash for CompilerErrorCode

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for CompilerErrorCode

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for CompilerErrorCode

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl TryFrom<i32> for CompilerErrorCode

Source§

type Error = UnknownCompilerErrorCode

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

fn try_from(code: i32) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl Copy for CompilerErrorCode

Source§

impl Eq for CompilerErrorCode

Source§

impl StructuralPartialEq for CompilerErrorCode

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,