This page documents all error codes in the Parser category.
Total codes: 84
- 84 error code(s)
- Severity: Error
- Code:
N1001
The parser expected a specific token (e.g. ';', ':', '=') at the current position but found something else. This usually means a syntax error, missing punctuation, or a misplaced construct near the indicated location.
- Severity: Error
- Code:
N1002
The parser encountered a token that does not make sense at the current position in the grammar. This is a generic syntax error that indicates a structural problem with the code around the indicated location.
- Severity: Error
- Code:
N1003
The parser expected an expression (a value-producing construct) but found something else. This can happen after operators, after =, after return, or in other expression contexts.
- Severity: Error
- Code:
N1004
A grouping delimiter (parenthesis, bracket, or brace) was opened but not closed by the expected token. Check the matching delimiter at the reported location.
- Severity: Error
- Code:
N1005
A colon (:) was followed by an end-of-line without an indented block on the next line. Nimble requires an indented body after function definitions, if/else, while, for, and other colon-terminated constructs.
- Severity: Error
- Code:
N1006
An indentation change occurs at an unexpected location, typically because a line is indented more than expected relative to surrounding blocks.
- Severity: Error
- Code:
N1007
The parser expected an identifier (a name) but found something else. Identifiers are required for variable names, function names, type names, and field access.
- Severity: Error
- Code:
N1008
A type annotation requires a type name but found something else. Type names come after colons in variable declarations and function signatures.
- Severity: Error
- Code:
N1009
A function or method parameter list contains a construct that is not a valid parameter name.
- Severity: Error
- Code:
N1010
A colon (:) was expected in a type annotation, label, or block-introducing construct but was not found.
- Severity: Error
- Code:
N1011
A semicolon (;) was expected but not found. In Nimble, semicolons are optional line separators but required in certain contexts like separating statements on the same line.
- Severity: Error
- Code:
N1012
An equals sign (=) was expected in an assignment, variable initializer, or default value but was not found.
- Severity: Error
- Code:
N1013
A function arrow (->) was expected in a return type annotation or lambda expression but was not found.
- Severity: Error
- Code:
N1014
A comma (,) was expected in a list (parameters, arguments, struct fields) but was not found.
- Severity: Error
- Code:
N1015
A dot (.) was expected for member access or qualified path access but was not found.
- Severity: Error
- Code:
N1016
A function declaration is missing its body. Functions must have either a body block or be declared as extern.
- Severity: Error
- Code:
N1017
A function with a declared return type is missing a return expression in its body, or a non-void function is missing its return type annotation.
- Severity: Error
- Code:
N1018
A function parameter list contains an invalid parameter. Parameters must have the form name: Type or name.
- Severity: Error
- Code:
N1019
A function declaration exceeds the maximum number of allowed parameters defined by the compiler limit.
- Severity: Error
- Code:
N1020
A function call provides fewer arguments than the function signature expects.
- Severity: Error
- Code:
N1021
The parser expected a statement (declaration, assignment, expression statement, etc.) at the current position.
- Severity: Error
- Code:
N1022
Expected a let or var binding declaration at this position. In Nimble, variables must be explicitly declared with let (immutable) or var (mutable).
- Severity: Error
- Code:
N1023
A specific keyword (if, else, while, for, return, fn, etc.) was expected at this position.
- Severity: Error
- Code:
N1024
The left-hand side of an assignment operator (=, +=, etc.) is not a valid assignment target. Only variables, mutable fields, and indexed expressions can be assigned to.
- Severity: Error
- Code:
N1025
A function is nested inside another function but the context does not support closures. Nested functions require closure support.
- Severity: Error
- Code:
N1026
A function has two parameters with the same name. Parameter names must be unique within a function signature.
- Severity: Error
- Code:
N1027
A parameter with a default value appears before a parameter without one. All parameters with defaults must come after parameters without defaults.
- Severity: Error
- Code:
N1028
An import or use statement expects a module path (a sequence of identifiers separated by :: or dots) but found something else.
- Severity: Error
- Code:
N1029
An import statement expects a symbol name to import from a module.
- Severity: Error
- Code:
N1030
Two or more modules directly or indirectly import each other, creating a cycle. Nimble does not allow circular imports.
- Severity: Error
- Code:
N1031
A break statement appears outside of any enclosing loop (while, for). break is only valid within loop bodies.
- Severity: Error
- Code:
N1032
A continue statement appears outside of any enclosing loop. continue is only valid within loop bodies.
- Severity: Error
- Code:
N1033
A return statement appears outside of any function body. return is only valid inside functions.
- Severity: Error
- Code:
N1034
A yield expression appears outside of a generator function. yield is only valid inside generators.
- Severity: Error
- Code:
N1035
The binding pattern in a for-loop is invalid. For-loops require an identifier or destructuring pattern followed by in and an iterable expression.
- Severity: Error
- Code:
N1036
A for-loop is missing the in keyword between the binding and the iterable expression.
- Severity: Error
- Code:
N1037
A struct declaration has no fields. Structs must have at least one field.
- Severity: Error
- Code:
N1038
An interface declaration has no methods. Interfaces must have at least one method signature.
- Severity: Error
- Code:
N1039
A method-like declaration appears outside of an interface or struct body.
- Severity: Error
- Code:
N1040
A struct has two or more fields with the same name. Field names must be unique within a struct.
- Severity: Error
- Code:
N1041
A struct literal uses a positional (unnamed) value but the struct expects named fields. Use field: value syntax.
- Severity: Error
- Code:
N1042
A struct literal expression is expected but something else was found. Struct literals use Name { field: value, ... } syntax.
- Severity: Error
- Code:
N1043
A type annotation is missing the colon separator between the name and its type. Use name: Type syntax.
- Severity: Error
- Code:
N1044
A trailing comma appears where it is not syntactically allowed.
- Severity: Error
- Code:
N1045
A string interpolation expression within a string has invalid syntax. Interpolation expressions must be valid expressions enclosed in the proper delimiters.
- Severity: Error
- Code:
N1046
A block comment (/) was started but the closing (/) was not found before end of file.
- Severity: Error
- Code:
N1047
An attribute annotation is expected at this position. Attributes use #[name] syntax.
- Severity: Error
- Code:
N1048
An attribute is applied to a construct that does not support attributes.
- Severity: Error
- Code:
N1049
The same attribute is applied more than once to the same construct.
- Severity: Error
- Code:
N1050
An unrecognized attribute name was used. Check the spelling of the attribute.
- Severity: Error
- Code:
N1051
A generic type is missing its type argument list. Use Type<T, U> syntax.
- Severity: Error
- Code:
N1052
A type argument list (<) was opened but not closed (>) before the expected position.
- Severity: Error
- Code:
N1053
The number of type arguments provided does not match the number of type parameters defined by the generic.
- Severity: Error
- Code:
N1054
A < token was expected to open a generic or type argument list.
- Severity: Error
- Code:
N1055
A > token was expected to close a generic or type argument list.
- Severity: Error
- Code:
N1056
A lambda expression has no body or the body is incomplete. Lambdas use |params| expr syntax.
- Severity: Error
- Code:
N1057
A for-loop is missing its binding variable. Use for var in iter: body.
- Severity: Error
- Code:
N1058
A qualified path expression was expected. Paths use module::name or object.field syntax.
- Severity: Error
- Code:
N1059
A literal value was expected but something else was found.
- Severity: Error
- Code:
N1060
A pattern (used in match arms, destructuring, or binding) was expected but something else was found.
- Severity: Error
- Code:
N1061
A match arm with a guard (if clause) is missing the guard expression after if.
- Severity: Error
- Code:
N1062
Expected a where clause for specifying trait bounds or constraints.
- Severity: Error
- Code:
N1063
A statement must be terminated by either a semicolon or a newline. Two statements cannot appear on the same line without a separator.
- Severity: Error
- Code:
N1064
An operator (such as +, -, *, /, ==, etc.) was expected at this position, typically in an expression context.
- Severity: Error
- Code:
N1065
The prefix operator used is not valid for the type of expression it precedes.
- Severity: Error
- Code:
N1066
The postfix operator used is not valid for the type of expression it follows.
- Severity: Error
- Code:
N1067
The combination of operators in an expression is ambiguous and requires explicit grouping with parentheses.
- Severity: Error
- Code:
N1068
Comparisons of different types or incompatible operators cannot be chained together. Use parentheses to group comparisons explicitly.
- Severity: Error
- Code:
N1069
A tuple expression or type is missing an element. Use (a, b, c) syntax with commas between elements.
- Severity: Error
- Code:
N1070
An array literal is missing an element. Use [a, b, c] syntax with commas between elements.
- Severity: Error
- Code:
N1071
A struct literal is missing a field. Use Struct { field: value } syntax.
- Severity: Error
- Code:
N1072
An enum variant pattern or constructor was expected but something else was found.
- Severity: Error
- Code:
N1073
A match expression must have at least one arm (pattern => expression). Add at least one match arm.
- Severity: Error
- Code:
N1074
A match arm pattern is not followed by =>. Use pattern => expression syntax.
- Severity: Error
- Code:
N1075
A match arm guard (if clause) is missing its condition expression.
- Severity: Error
- Code:
N1076
A doc comment (/// or //!) appears in a position where documentation is not allowed.
- Severity: Error
- Code:
N1077
A documentation comment was expected, typically before a public API item.
- Severity: Error
- Code:
N1078
A visibility modifier (pub, pub(crate), etc.) is being used in an invalid position or with an incorrect syntax.
- Severity: Error
- Code:
N1079
A top-level or nested item (function, struct, interface, constant, etc.) was expected at this position.
- Severity: Error
- Code:
N1080
A nested function declaration has no body. Nested functions must have an inline body.
- Severity: Error
- Code:
N1081
A generic parameter list (<) was started but not closed (>) before a structural end was reached.
- Severity: Error
- Code:
N1082
A lifetime parameter (using 'a syntax) was expected but not found.
- Severity: Error
- Code:
N1083
A const generic parameter was expected but not found. Const parameters use const NAME: Type syntax.
- Severity: Error
- Code:
N1084
A numeric literal has a suffix that could refer to multiple types or is not a recognized suffix. Add an explicit type annotation or use a standard suffix.