Skip to content

Error Handling and Diagnostics

egyptron edited this page Sep 25, 2026 · 2 revisions

Error Handling & Diagnostics

Awake Simple S1 incorporates an intelligent runtime diagnostic engine powered by the Levenshtein Distance algorithm. It checks every line against canonical command patterns before execution.


Diagnostic Output Formatting

The engine uses ANSI terminal coloring:

  • Errors & Typos: Bold Red
  • Did-You-Mean Suggestions: Bold Green
  • Warnings: Bold Yellow

1. Fuzzy Typo Matching

If a command contains a spelling mistake or typo, the engine calculates string similarity and recommends the correct syntax.

Example Script:

disply("Hello World!")

Terminal Diagnostic:

========================================================
SYNTAX ERROR on line 1:
  "disply("Hello World!")" is not recognized;
  did you mean "display("...")"?
========================================================

2. Completely Unrecognized Statements

If a line cannot be matched to any language command or property:

Example Script:

xyz_completely_random_statement

Terminal Diagnostic:

========================================================
SYNTAX ERROR on line 1:
  "xyz_completely_random_statement" is not recognized
========================================================

3. Template Property Validation

The validator also inspects lines inside window templates:

Example Script:

show window template "rpg-battle":
   player_hp = 100
finish window;

Terminal Diagnostic:

========================================================
SYNTAX ERROR on line 2:
  "playr_hp = 100" is not recognized;
  did you mean "player_hp = <number>"?
========================================================

Clone this wiki locally