Skip to content

Commit

Permalink
compiler: clarify the errors
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Perkowski <[email protected]>
  • Loading branch information
adamperkowski committed Jan 12, 2025
1 parent cf1c7d6 commit 9671cbe
Showing 1 changed file with 93 additions and 93 deletions.
186 changes: 93 additions & 93 deletions std/jule/build/log.jule
Original file line number Diff line number Diff line change
Expand Up @@ -7,134 +7,134 @@ use "std/internal/stringslite"
// Compiler log messages with formatting.
enum LogMsg: str {
Empty: "",
StdlibNotExist: `standard library directory not found`,
FileNotUseable: `file is not useable for this operating system or architecture`,
FileNotJule: `this is not jule source file: @`,
NoEntryPoint: `missing entry point: entry point (main) function is not defined`,
DuplicatedIdent: `identifier "@" is duplicated for scope, used by another declaration`,
ExtraClosedParent: `extra closed parentheses`,
ExtraClosedBrace: `extra closed braces`,
ExtraClosedBracket: `extra closed brackets`,
WaitCloseParent: `parentheses waiting to close`,
WaitCloseBrace: `brace waiting to close`,
WaitCloseBracket: `bracket are waiting to close`,
ExpectedParentClose: `was expected parentheses close`,
ExpectedBraceClose: `was expected brace close`,
ExpectedBracketClose: `was expected bracket close`,
BodyNotExist: `body is not exist`,
StdlibNotExist: `standard library not found`,
FileNotUseable: `file is not usable for this operating system or architecture`,
FileNotJule: `@ is not a Jule source file`,
NoEntryPoint: `missing entry point: (main) is not defined`,
DuplicatedIdent: `duplicate "@" identifier in this scope`,
ExtraClosedParent: `extra closing parentheses`,
ExtraClosedBrace: `extra closing brace`,
ExtraClosedBracket: `extra closing bracket`,
WaitCloseParent: `parentheses open but not closed`,
WaitCloseBrace: `braces open but not closed`,
WaitCloseBracket: `brackets open but not closed`,
ExpectedParentClose: `closing parentheses expected`,
ExpectedBraceClose: `closing brace expected`,
ExpectedBracketClose: `closing bracket expected`,
BodyNotExist: `body not found`,
OperatorOverflow: `operator overflow: repetitive operators`,
IncompatibleTypes: `mismatched types: @ and @`,
IncompatibleTypes: `mismatched types: @ != @`,
OperatorNotForJuleType: `operator @ is not defined for type @`,
OperatorNotForFloat: `operator @ is not defined for floating-point type(s)`,
OperatorNotForInt: `operator @ is not defined for integer type(s)`,
OperatorNotForUint: `operator @ is not defined for unsigned integer type(s)`,
OperatorNotForFloat: `operator @ is not defined for floating-point types`,
OperatorNotForInt: `operator @ is not defined for integer types`,
OperatorNotForUint: `operator @ is not defined for unsigned integer types`,
IdentNotExist: `undefined identifier: @`,
NotFuncCall: `value is not function`,
ArgumentOverflow: `argument overflow: passed more argument than expected to call @`,
FuncHaveRet: `function @ cannot have return type`,
FuncHaveParameters: `function @ cannot have parameter(s)`,
RequireRetExpr: `return statements of non-void functions should have return expression`,
VoidFuncRetExpr: `void functions is cannot returns any value`,
BitShiftMustUnsigned: `bit shifting value is must be unsigned`,
LogicalNotBool: `logical expression is have only boolean type values`,
AssignConst: `constants is can't assign`,
AssignRequireLvalue: `invalid expression: expected lvalue for assignment`,
AssignTypeNotSupportValue: `type is not support assignment`,
NotFuncCall: `value is not a function`,
ArgumentOverflow: `@ expected less arguments`,
FuncHaveRet: `function @ doesn't have a return type`,
FuncHaveParameters: `function @ doesn't require any parameters`,
RequireRetExpr: `non-void functions should return a value`,
VoidFuncRetExpr: `void functions cannot return a value`,
BitShiftMustUnsigned: `bit shifting value must be unsigned`,
LogicalNotBool: `logical expression must be boolean`,
AssignConst: `constants cannot be assigned`,
AssignRequireLvalue: `invalid expression: expected lvalue`,
AssignTypeNotSupportValue: `type does not support assignment`,
InvalidToken: `undefined token: @`,
InvalidSyntax: `invalid syntax`,
InvalidType: `invalid type`,
InvalidNumericRange: `arithmetic value overflow: this value too big`,
InvalidExprForUnary: `unary operator @ is not defined for type @`,
InvalidNumericRange: `arithmetic value out of range`,
InvalidExprForUnary: `unary operator @ not defined for type @`,
InvalidEscapeSeq: `invalid escape sequence`,
InvalidTypeSource: `invalid type source`,
InvalidTypeForConst: `@ is invalid data-type for constant`,
InvalidTypeForConst: `@ is not a constant type`,
InvalidExpr: `invalid expression`,
InvalidCppExt: `invalid C++ extension: @`,
InvalidLabel: `invalid label: @`,
InvalidExprForTypeInference: `invalid expression for type inference`,
MissingValueForTypeInference: `type inferred declarations should have a initializer expression`,
MissingValueForTypeInference: `type inferred declarations should have an initializer expression`,
MissingType: `type missing`,
MissingExpr: `expression missing`,
MissingBlockCommentClose: `missing block comment close`,
MissingRuneEnd: `rune is not finished`,
MissingBlockCommentClose: `block comment not closed`,
MissingRuneEnd: `rune not finished`,
MissingRet: `missing return at end of function`,
MissingStrEnd: `string is not finished`,
MissingStrEnd: `string not closed`,
MissingMultiRet: `missing return expressions for multi-return`,
MissingMultiAssignIdents: `missing identifier(s) for multiple assignment`,
MissingUsePath: `missing path of use statement`,
MissingUsePath: `missing path`,
MissingGotoLabel: `missing label identifier for goto statement`,
MissingExprFor: `missing expression for @`,
MissingGenerics: `missing generics`,
MissingReceiver: `missing receiver parameter`,
MissingFuncParentheses: `missing function parentheses`,
ExprNotConst: `expressions is not constant expression`,
NilForTypeInference: `nil is cannot use with type inferred definitions`,
VoidForTypeInference: `void data is cannot use for type inferred definitions`,
RuneEmpty: `rune is cannot empty`,
RuneOverflow: `rune is should be single`,
NotSupportsIndexing: `type @ is not support indexing`,
NotSupportsSlicing: `type @ is not support slicing`,
ExprNotConst: `expression is not constant`,
NilForTypeInference: `nil cannot be used with type inferred definitions`,
VoidForTypeInference: `void data cannot be used for type inferred definitions`,
RuneEmpty: `rune cannot be empty`,
RuneOverflow: `rune value out of range`,
NotSupportsIndexing: `type @ does not support indexing`,
NotSupportsSlicing: `type @ does not support slicing`,
AlreadyConst: `define is already constant`,
AlreadyVariadic: `define is already variadic`,
AlreadyReference: `define is already reference`,
StaticReference: `static variables cannot be reference`,
DuplicateUseDecl: `use declaration duplication: @ is already used above`,
IgnoreIdent: `ignore operator cannot use as identifier for this declaration`,
OverflowMultiAssignIdents: `overflow multi assignment identifers`,
DuplicateUseDecl: `@ is already being used`,
IgnoreIdent: `ignore operator cannot be used as an identifier for this declaration`,
OverflowMultiAssignIdents: `overflow multi assignment identifiers`,
OverflowRet: `overflow return expressions`,
BreakAtOutOfValidScope: `break keyword is cannot used at out of iteration and match cases`,
ContinueAtOutOfValidScope: `continue keyword is cannot used at out of iteration`,
IterWhileRequireBoolExpr: `while iterations must be have boolean expression`,
IterRangeRequireEnumerableExpr: `range iterations must be have enumerable expression`,
MuchRangeVars: `range variables can be maximum two`,
IfRequireBoolExpr: `if conditions must be have boolean expression`,
ElseHaveExpr: `else's cannot have any expression`,
VariadicParamNotLast: `variadic parameter can only be last parameter`,
BreakAtOutOfValidScope: `break keyword not in valid scope`,
ContinueAtOutOfValidScope: `continue keyword not in valid scope`,
IterWhileRequireBoolExpr: `while iterations require boolean expression`,
IterRangeRequireEnumerableExpr: `range iterations must have enumerable expression`,
MuchRangeVars: `range variables out of range (ironically)`,
IfRequireBoolExpr: `if conditions require boolean expression`,
ElseHaveExpr: `else conditions cannot have expressions`,
VariadicParamNotLast: `variadic parameter must be last parameter`,
VariadicWithNonVariadicable: `type @ is not variadicable`,
MoreArgsWithVariadiced: `variadic argument can't use with more argument`,
VariadicReference: `variadic storage cannot be reference`,
TypeNotSupportsCasting: `type @ not supports casting`,
TypeNotSupportsCastingTo: `type @ not supports casting to type @`,
UseAtContent: `use declaration must be start of source code`,
UseNotFound: `used directory path not found/access: @`,
DefNotSupportPub: `define is not supports modifier`,
ObjNotSupportSubFields: `object @ is not supports sub-defines`,
ObjHaveNotIdent: `undefined identifier: type @ has no field or method @`,
MoreArgsWithVariadiced: `variadic argument cannot use with more arguments`,
VariadicReference: `variadic storage cannot be a reference`,
TypeNotSupportsCasting: `type @ does not support casting`,
TypeNotSupportsCastingTo: `type @ does not support casting to type @`,
UseAtContent: `use declaration must be at the top of source code`,
UseNotFound: `path not found or cannot be accessed: @`,
DefNotSupportPub: `define does not support modifiers`,
ObjNotSupportSubFields: `object @ does not support sub-defines`,
ObjHaveNotIdent: `type @ has no field or method: @`,
TypeNotSupportSubFields: `type @ is not supports sub-defines`,
TypeHaveNotIdent: `undefined identifier: type @ has no field or method @`,
TypeHaveNotIdent: `type @ has no field or method: @`,
DeclaredButNotUsed: `@ declared but not used`,
ExprNotFuncCall: `statement must have function call expression`,
LabelExist: `label is already exist in this identifier: @`,
LabelNotExist: `not exist any label in this identifier: @`,
ExprNotFuncCall: `statement must be a function call`,
LabelExist: `label already exists for this identifier: @`,
LabelNotExist: `the label @ does not exist`,
GotoJumpsDeclarations: `goto @ jumps over declaration(s)`,
FuncNotHasParam: `function is not has parameter in this identifier: @`,
AlreadyHasExpr: `@ already has expression`,
ArgMustTargetToField: `argument must target to field`,
FuncNotHasParam: `function does not have a parameter in this identifier: @`,
AlreadyHasExpr: `@ already has an expression`,
ArgMustTargetToField: `argument must target a field`,
OverflowLimits: `overflow the limit of data-type`,
GenericsOverflow: `overflow generics`,
HasGenerics: `type has generics and used without instantiate`,
NotHasGenerics: `type have not generics but instantiate like generics`,
TypeNotSupportsGenerics: `type not supports generics`,
DivByZero: `divide by zero`,
TraitHaveNotIdent: `undefined identifier: trait @ has no define @`,
HasGenerics: `type has generics but not instantiated with generics`,
NotHasGenerics: `type has no generics but instantiated with generics`,
TypeNotSupportsGenerics: `type does not support generics`,
DivByZero: `don't divide by zero`,
TraitHaveNotIdent: `trait @ has no define @`,
NotImplTraitDef: `trait @ derived but not implemented define @`,
DynamicTypeAnnotationFailed: `dynamic type annotation failed`,
FallthroughWrongUse: `fall keyword can only useable at end of the case scopes`,
FallthroughIntoFinalCase: `fall cannot useable at final case`,
UnsafeBehaviorAtOutOfUnsafeScope: `unsafe behaviors cannot available out of unsafe scopes`,
RefMethodUsedWithNotRefInstance: `reference method cannot use with non-reference instance`,
MethodAsAnonFunc: `non-static methods cannot use as anonymous function`,
BindedFuncAsAnonFunc: `binded functions cannot use as anonymous function`,
GenericedFuncAsAnonFunc: `genericed functions cannot use as anonymous function`,
IllegalCycleRefersItself: `illegal cycle in declaration, @ refers to itself`,
IllegalCrossCycle: "illegal cross cycle in declarations;\n@",
FallthroughWrongUse: `fall keyword can only be used at end of case scopes`,
FallthroughIntoFinalCase: `fall cannot be used in the final case`,
UnsafeBehaviorAtOutOfUnsafeScope: `unsafe call outside of unsafe scope`,
RefMethodUsedWithNotRefInstance: `reference method cannot be used with a non-reference instance`,
MethodAsAnonFunc: `non-static methods cannot be anonymized`,
BindedFuncAsAnonFunc: `binded functions cannot be anonymized`,
GenericedFuncAsAnonFunc: `genericed functions cannot be anonymized`,
IllegalCycleRefersItself: `illegal cycle in declaration: @ refers to itself`,
IllegalCrossCycle: "illegal cross cycle in declaration:\n@",
AssignToNonMut: `cannot assign to immutable storage`,
AssignNonMutToMut: `immutable data cannot assign to mutable storage because of @ type which is mutable`,
RetWithMutTypedNonMut: `mutable typed return expressions should be mutable`,
MutOperationOnImmut: `mutable operation cannot used with immutable data`,
TraitHasRefParamFunc: `trait has reference receiver parameter used method, cannot assign non-reference instance`,
EnumHaveNotField: `undefined identifier: enum @ has no field @`,
DuplicateMatchType: `duplicated pattern: type @ is already matched`,
AssignNonMutToMut: `immutable data cannot be assigned to mutable storage because of @ type, which is mutable`,
RetWithMutTypedNonMut: `mutable return expressions should be mutable`,
MutOperationOnImmut: `mutable operations cannot be used with immutable data`,
TraitHasRefParamFunc: `trait uses a reference receiver parameter method, cannot assign non-reference instance`,
EnumHaveNotField: `enum @ has no field: @`,
DuplicateMatchType: `type @ is already matched`,
BindedVarHasExpr: `binded variables cannot have expression`,
BindedVarIsConst: `binded variables cannot be constant`,
ConstVarNotHaveExpr: `missing expression for constant variable initialization`,
Expand Down Expand Up @@ -274,7 +274,7 @@ enum LogMsg: str {
ExpectedLeftOperand: `left operand expected for binary operator`,
ExpectedRightOperand: `right operand expected for binary operator`,
ExpectedColon: `expected colon ":"`,
ExpectedBody: `expected a body, bodies should start in same line with their definition and declared with braces "{ }"`,
ExpectedBody: `expected a body, bodies should start in same line with their definition and declared with brackets "{ }"`,
ExpectedType: `expected type declaration`,
ExpectedPlainUseDecl: `expected plain use declaration for this package like: @`,
DeclareComptimeForeach: `declarate comptime iteration like: const for ...`,
Expand Down

0 comments on commit 9671cbe

Please sign in to comment.