cheesestraws / calculogue

The Calculogue is an exercise in comparative programming.
5 stars 2 forks source link

Spec: standard error messages #10

Open fallax opened 4 years ago

fallax commented 4 years ago

List in the spec common error cases that implementers should handle and test for:

STACK STATE ERRORS

100: Stack underflow on (which) stack. 110: Stack underflow popping (number) items from (which) stack. 150: Stack overflow pushing to (which) stack.

TOKEN PARSE ERRORS

200: No such verb exists. 210: No such predicate exists. 220: Token is not a valid number. 225: Token is not a valid floating point number. 250: Token must start with "\", "#", "'", or a stack identifier. 251: Missing "#" or "'" after stack identifier "(which)". 260: Token must not reference (which) stack in the root execution context.

TYPE ERRORS

300: Token is a number and cannot be executed.

PARAMETER TYPE ERRORS

400: Length (first parameter) must be an integer. 450: Name (first parameter) must be a string.

FATAL EXECUTION WARNINGS (optional)

500: \while has executed too many times (executed (number) times). 510: Too many execution contexts created ((number) contexts created). 520: Execution stack length exceeded sensible limit ((number) tokens). 550: Token too large ((number) characters long).

FATAL TIMEOUTS (optional)

600: Execution timeout (execution took more than (number) seconds).

INTERNAL INTERPRETER ERRORS (800-899)

OTHER

900: This feature is not yet supported. 910: Input file "(path)" not found. 911: Input file "(path)" could not be opened. 920: Module not found. 921: Module could not be loaded. 999: Execution was stopped using \die.