Skip to main content
The Hypotenuse Compiler catches errors at multiple stages of compilation: the lexer and parser raise syntax errors, the structurer raises scope errors, and the simulation pass raises memory errors. Error messages also include personality messages — randomized flavor text that makes error output more human and easier to spot in a busy terminal. This page covers all error categories with causes and fixes.

Syntax Errors

The parser raises these errors when the token stream doesn’t match expected grammar. Syntax errors always include the offending token and its position in the file.
ErrorCauseExample
Unexpected token at top-levelUnknown token outside a function@foo at file root
Expected IDENTIFIERType keyword not followed by a nameint 42
Expected RPARENUnclosed function call or for-loop headerfoo(1, 2
Expected SEMICOLONMissing ; at end of statementint x = 5
Unexpected end of fileUnclosed { blockMissing closing }
Unexpected token in primary expressionInvalid token at the start of an expressionint + 3
The examples above illustrate the most common triggers for each error. The same error message can be raised in other contexts — always read the position information alongside the message to locate the exact problem.

Deprecated Keyword Errors

The lexer raises these errors immediately when it encounters a deprecated C11 keyword. Compilation stops as soon as the keyword is found, before any further parsing takes place.
KeywordError Message
restrictDeprecated keyword used! Please remove or replace the keyword. Found 'RESTRICT'.
_BoolDeprecated keyword used! Please remove or replace the keyword. Found 'BOOLEAN'.
All deprecated keywords — restrict, _Bool, _Complex, and _Imaginary — abort compilation immediately. Remove or replace them before re-running the compiler. See the Keywords reference for the full list.

Scope Errors

The structurer raises scope errors while building the Callee/Caller/Scope graph. These errors indicate conflicts in how names are declared and used across scopes.
ErrorCause
Child named X already exists in scope YA variable or function named X is declared more than once in scope Y
Remember that for loop init declarations create their own child scope. A variable declared in a for init is not visible in the enclosing function scope, but it will conflict with another variable of the same name declared in the same for header.

Memory Errors

The simulation pass raises memory errors during static analysis of pointer lifetimes and function call graphs.
ErrorCause
callee not foundA function call references a callee that was never defined
Use after autoremove dropYour code accesses a pointer after its autoremove free point
Invalid robberyA robbery target is not a valid autoremove pointer
When you declare a pointer with autoremove, the simulation pass determines the last point in your code where that pointer is used and inserts a free call there automatically.Use after autoremove drop means you reference the pointer again after that auto-inserted free. To fix this, either extend the pointer’s lifetime by moving the last use later, or switch to manual free.Invalid robbery means you attempted to “rob” (transfer ownership of) a pointer that was not declared with autoremove. Only autoremove pointers can be the target of a robbery operation.

File Errors

The compiler raises file errors before compilation begins, when it cannot read the input source.
ErrorCause
Error: file not found <path>The source file at <path> does not exist
Error reading file: <details>The OS reported a failure while reading the file — check permissions and disk health

Debugging Tips

Run with -t to print the full lexed token stream before any errors reach the parser. This lets you see exactly what the lexer produces and spot unexpected tokens early.
Run with -p to print the full Callee/Caller/Scope graph. Use this when you get a scope error and want to see how the structurer resolved every name in your file.
Unclosed { braces are the single most common cause of Unexpected end of file errors. If you see an EOF error, work backwards through your file and check that every opening brace has a matching closing brace.
Deprecated keywords (restrict, _Bool, _Complex, _Imaginary) stop compilation immediately at the lexer stage — no other errors will appear until you remove them. Search your source for these keywords first if compilation exits with a deprecated keyword error.