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.
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.
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.
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.
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.

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.