#[cfg(feature = "compile-with-external-structures")]
use crate::containers::ExternalStringPtr;
#[cfg(feature = "compile-with-external-structures")]
type StringPtr = ExternalStringPtr;
#[cfg(not(feature = "compile-with-external-structures"))]
type StringPtr = String;
#[derive(Debug, Clone, PartialEq, Eq)]
#[repr(C)]
pub enum DiagnosticMessage {
FractionAfterNumeric,
NoDigitsAfterDot,
UnknownTypeOfPercentString,
NumericLiteralWithoutDigits,
UnterminatedList,
UnterminatedRegexp,
UnterminatedString,
UnterminatedQuotedString,
InvalidUnicodeEscape,
TooLargeUnicodeCodepoint,
InvalidUnicodeCodepoint,
MultipleCodepointAtSingleChar,
InvalidEscapeCharacter,
InvalidHexEscape,
UnterminatedHeredoc {
heredoc_id: StringPtr,
},
UnterminatedHeredocId,
SlashRAtMiddleOfLine,
DStarInterpretedAsArgPrefix,
StarInterpretedAsArgPrefix,
AmpersandInterpretedAsArgPrefix,
TripleDotAtEol,
ParenthesesIterpretedAsArglist,
AmbiguousFirstArgument {
operator: u8,
},
AmbiguousOperator {
operator: StringPtr,
interpreted_as: StringPtr,
},
InvalidCharacterSyntax {
suggestion: StringPtr,
},
InvalidOctalDigit,
TrailingCharInNumber {
c: u8,
},
EmbeddedDocumentMeetsEof,
InvalidChar {
c: u8,
},
IncompleteCharacterSyntax,
GvarWithoutId,
InvalidGvarName {
c: u8,
},
IvarWithoutId,
InvalidIvarName {
c: u8,
},
CvarWithoutId,
InvalidCvarName {
c: u8,
},
UnknownRegexOptions {
options: StringPtr,
},
UnterminatedUnicodeEscape,
EncodingError {
error: StringPtr,
},
InvalidMultibyteChar,
AmbiguousTernaryOperator {
condition: StringPtr,
},
AmbiguousRegexp,
ElseWithoutRescue,
BeginNotAtTopLevel,
AliasNthRef,
CsendInsideMasgn,
ClassOrModuleNameMustBeConstant,
EndlessSetterDefinition,
UnexpectedToken {
token_name: StringPtr,
},
ClassDefinitionInMethodBody,
ModuleDefinitionInMethodBody,
InvalidReturnInClassOrModuleBody,
ConstArgument,
IvarArgument,
GvarArgument,
CvarArgument,
NoSuchLocalVariable {
var_name: StringPtr,
},
OrdinaryParamDefined,
NumparamUsed,
TokAtEolWithoutExpression {
token_name: StringPtr,
},
EndInMethod,
ComparisonAfterComparison {
comparison: StringPtr,
},
CircularArgumentReference {
arg_name: StringPtr,
},
DynamicConstantAssignment,
CantAssignToSelf,
CantAssignToNil,
CantAssignToTrue,
CantAssignToFalse,
CantAssignToFile,
CantAssignToLine,
CantAssignToEncoding,
CantAssignToNumparam {
numparam: StringPtr,
},
CantSetVariable {
var_name: StringPtr,
},
BlockGivenToYield,
BlockAndBlockArgGiven,
SymbolLiteralWithInterpolation,
ReservedForNumparam {
numparam: StringPtr,
},
KeyMustBeValidAsLocalVariable,
DuplicateVariableName,
DuplicateKeyName,
SingletonLiteral,
NthRefIsTooBig {
nth_ref: StringPtr,
},
DuplicatedArgumentName,
RegexError {
error: StringPtr,
},
InvalidSymbol {
symbol: StringPtr,
},
VoidValueExpression,
}