Compiler Diagnostics
Matchbox reports the problem followed by a source line and column. Begin at that location, but also inspect the token immediately before it because a missing separator or closing delimiter can shift where the parser notices the problem.
Undefined Name
Error: total is undefined on line 1:7
Declare variables and define functions before using them. Check spelling and scope.
Uninitialized Variable
Error: count is uninitialized on line 2:7
Assign a declared variable before reading it:
var count int
count = 0
print(count)
Redefinition
Error: Redefinition of value on line 2:5
Do not declare the same name twice in one scope. Rename the second declaration or assign to the existing variable without var.
Invalid Function Arguments
Error: Invalid arguments to function max on line 1:14
Check the number of arguments against the function signature. All arguments in 0.2 must be integers.
Unexpected Token or End of Input
These diagnostics commonly indicate a missing expression, closing parenthesis, closing brace, comma, or same-line semicolon. Compare the code with Syntax Overview.
Stack Overflow
Error: Stack overflow
The program exceeded the virtual machine's fixed stack. Reduce nested function calls or split a large expression into smaller statements.
File and Option Errors
Error: Could not read file ... means the path is wrong or inaccessible. Unknown option: ... means the command contains an unsupported option. See Command Line.