You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ErrorPattern{pattern:"omc_code_complexity: parse error",category:"parser",explanation:"`omc_code_complexity` couldn't parse its input.",typical_cause:"Source is malformed OMC.",fix:"Test the source standalone via `omc --check file.omc` first."},
1121
1121
ErrorPattern{pattern:"omc_code_diff: parse error",category:"parser",explanation:"`omc_code_diff` couldn't parse its input.",typical_cause:"Source is malformed OMC.",fix:"Test the source standalone via `omc --check file.omc` first."},
1122
1122
ErrorPattern{pattern:"omc_code_metrics: parse error",category:"parser",explanation:"`omc_code_metrics` couldn't parse its input.",typical_cause:"Source is malformed OMC.",fix:"Test the source standalone via `omc --check file.omc` first."},
1123
+
ErrorPattern{pattern:"Expected RParen,",category:"parser",explanation:"Parser expected a closing paren ')' at this position.",typical_cause:"Misplaced or missing punctuation, or unbalanced delimiter earlier in source.",fix:"Check surrounding source for missing/extra closing paren ')'."},
1124
+
ErrorPattern{pattern:"Expected RBrace,",category:"parser",explanation:"Parser expected a closing brace '}' at this position.",typical_cause:"Misplaced or missing punctuation, or unbalanced delimiter earlier in source.",fix:"Check surrounding source for missing/extra closing brace '}'."},
1125
+
ErrorPattern{pattern:"Expected RBracket,",category:"parser",explanation:"Parser expected a closing bracket ']' at this position.",typical_cause:"Misplaced or missing punctuation, or unbalanced delimiter earlier in source.",fix:"Check surrounding source for missing/extra closing bracket ']'."},
1126
+
ErrorPattern{pattern:"Expected Semicolon,",category:"parser",explanation:"Parser expected a ';' terminator at this position.",typical_cause:"Misplaced or missing punctuation, or unbalanced delimiter earlier in source.",fix:"Check surrounding source for missing/extra ';' terminator."},
1127
+
ErrorPattern{pattern:"Expected Comma,",category:"parser",explanation:"Parser expected a ',' separator at this position.",typical_cause:"Misplaced or missing punctuation, or unbalanced delimiter earlier in source.",fix:"Check surrounding source for missing/extra ',' separator."},
1128
+
ErrorPattern{pattern:"Expected Colon,",category:"parser",explanation:"Parser expected a ':' separator at this position.",typical_cause:"Misplaced or missing punctuation, or unbalanced delimiter earlier in source.",fix:"Check surrounding source for missing/extra ':' separator."},
1129
+
ErrorPattern{pattern:"Expected Equal,",category:"parser",explanation:"Parser expected a '=' for assignment at this position.",typical_cause:"Misplaced or missing punctuation, or unbalanced delimiter earlier in source.",fix:"Check surrounding source for missing/extra '=' for assignment."},
1130
+
ErrorPattern{pattern:"Expected LBrace,",category:"parser",explanation:"Parser expected a block-opening '{' at this position.",typical_cause:"Misplaced or missing punctuation, or unbalanced delimiter earlier in source.",fix:"Check surrounding source for missing/extra block-opening '{'."},
1131
+
ErrorPattern{pattern:"Expected LParen,",category:"parser",explanation:"Parser expected a '(' for call/grouping at this position.",typical_cause:"Misplaced or missing punctuation, or unbalanced delimiter earlier in source.",fix:"Check surrounding source for missing/extra '(' for call/grouping."},
1132
+
ErrorPattern{pattern:"Expected LBracket,",category:"parser",explanation:"Parser expected a '[' for index/array at this position.",typical_cause:"Misplaced or missing punctuation, or unbalanced delimiter earlier in source.",fix:"Check surrounding source for missing/extra '[' for index/array."},
1133
+
ErrorPattern{pattern:"Expected Identifier,",category:"parser",explanation:"Parser expected a identifier name at this position.",typical_cause:"Misplaced or missing punctuation, or unbalanced delimiter earlier in source.",fix:"Check surrounding source for missing/extra identifier name."},
1134
+
ErrorPattern{pattern:"Expected Arrow,",category:"parser",explanation:"Parser expected a '=>' for match arm at this position.",typical_cause:"Misplaced or missing punctuation, or unbalanced delimiter earlier in source.",fix:"Check surrounding source for missing/extra '=>' for match arm."},
1135
+
ErrorPattern{pattern:"empty array",category:"runtime",explanation:"Operation called on an empty array.",typical_cause:"Edge case not guarded.",fix:"Check size/length before invoking."},
1136
+
ErrorPattern{pattern:"empty matrix",category:"runtime",explanation:"Operation called on an empty matrix.",typical_cause:"Edge case not guarded.",fix:"Check size/length before invoking."},
1137
+
ErrorPattern{pattern:"empty string",category:"runtime",explanation:"Operation called on an empty string.",typical_cause:"Edge case not guarded.",fix:"Check size/length before invoking."},
1138
+
ErrorPattern{pattern:"empty dict",category:"runtime",explanation:"Operation called on an empty dict.",typical_cause:"Edge case not guarded.",fix:"Check size/length before invoking."},
1139
+
ErrorPattern{pattern:"arr_get: first argument must be an array",category:"arrays",explanation:"Tried to index a non-array value.",typical_cause:"Confused dict with array, or passed scalar.",fix:"Use type_of(value) first; dict_get for dicts; cast or wrap as needed."},
1140
+
ErrorPattern{pattern:"dict_set: first argument must be a dict_variable",category:"dicts",explanation:"dict_set's first arg must be a bound dict variable, not an expression.",typical_cause:"Calling dict_set on a sub-expression that returns a dict.",fix:"Bind the dict to a variable first: `h d = expr(); dict_set(d, ...);`."},
1141
+
ErrorPattern{pattern:"Cannot call non-function value",category:"runtime",explanation:"Tried to invoke a value that isn't callable.",typical_cause:"Variable shadows a builtin / wrong type passed where function expected.",fix:"Check `type_of(value)` is 'function'."},
1142
+
ErrorPattern{pattern:"Cannot iterate non-array",category:"runtime",explanation:"for-in needs an array.",typical_cause:"Passed scalar/dict to for-in.",fix:"Use dict_items / dict_keys for dicts, or wrap scalar in [value]."},
1143
+
ErrorPattern{pattern:"string index out of bounds",category:"strings",explanation:"str_slice/str_get past end of string.",typical_cause:"Computed wrong slice.",fix:"Check str_len first; clamp indices to [0, len]."},
1144
+
ErrorPattern{pattern:"regex not found",category:"regex",explanation:"Pattern produced no match where one was required.",typical_cause:"Source doesn't contain the pattern.",fix:"Use re_match for a yes/no check before extracting groups."},
1145
+
ErrorPattern{pattern:"network unreachable",category:"io",explanation:"Could not reach destination.",typical_cause:"DNS/firewall/no internet.",fix:"Verify URL/host; check network connectivity."},
1146
+
ErrorPattern{pattern:"ssl handshake failed",category:"io",explanation:"TLS negotiation failed.",typical_cause:"Certificate mismatch or stale TLS.",fix:"Verify HTTPS URL; update CA bundle."},
1147
+
ErrorPattern{pattern:"http 404",category:"io",explanation:"HTTP request returned 404 Not Found.",typical_cause:"Wrong URL or resource removed.",fix:"Verify path; consider redirect handling."},
1148
+
ErrorPattern{pattern:"http 500",category:"io",explanation:"Server returned 500 Internal Server Error.",typical_cause:"Upstream service failure.",fix:"Retry with backoff; inspect server logs."},
1149
+
ErrorPattern{pattern:"http 401",category:"io",explanation:"HTTP 401 Unauthorized.",typical_cause:"Missing/expired auth token.",fix:"Refresh credentials and include auth header."},
1150
+
ErrorPattern{pattern:"http 403",category:"io",explanation:"HTTP 403 Forbidden.",typical_cause:"Auth ok but resource access denied.",fix:"Check ACLs / permissions."},
1151
+
ErrorPattern{pattern:"json key error",category:"json",explanation:"Required key missing in parsed JSON.",typical_cause:"Schema mismatch.",fix:"Verify the source / use dict_get_or with a default."},
1152
+
ErrorPattern{pattern:"yaml not supported",category:"stdlib",explanation:"OMC doesn't ship YAML; use JSON instead.",typical_cause:"Trying to load .yaml.",fix:"Convert YAML to JSON externally or use omc-yaml package if available."},
1153
+
ErrorPattern{pattern:"toml not supported",category:"stdlib",explanation:"OMC doesn't ship TOML.",typical_cause:"Looking for tomllib.",fix:"Use JSON or write a small parser."},
1154
+
ErrorPattern{pattern:"xml not supported",category:"stdlib",explanation:"OMC doesn't ship XML parsing.",typical_cause:"Trying to parse XML.",fix:"Use JSON; XML requires an external library."},
1155
+
ErrorPattern{pattern:"sql syntax error",category:"stdlib",explanation:"SQLite couldn't parse the query.",typical_cause:"Typo or wrong dialect.",fix:"Test the query in sqlite3 CLI first."},
1156
+
ErrorPattern{pattern:"sqlite locked",category:"io",explanation:"Database file is locked by another writer.",typical_cause:"Concurrent access.",fix:"Use WAL mode or coordinate writers."},
1157
+
ErrorPattern{pattern:"OMC version mismatch",category:"runtime",explanation:"Bytecode/serialised form from a different OMC version.",typical_cause:"Cached file is stale.",fix:"Clear cache, regenerate from source."},
1158
+
ErrorPattern{pattern:"missing return",category:"runtime",explanation:"Function exited without an explicit return.",typical_cause:"Code path forgot a return.",fix:"Add explicit return; OMC defaults to null but may be ambiguous."},
1159
+
ErrorPattern{pattern:"unreachable code",category:"runtime",explanation:"Statements after an unconditional return/throw/break.",typical_cause:"Dead code.",fix:"Remove the unreachable code or fix the control flow."},
1160
+
ErrorPattern{pattern:"omc_help requires",category:"introspection",explanation:"`omc_help` arity mismatch.",typical_cause:"Wrong arg count.",fix:"Run `omc_help(\"omc_help\")` for the signature."},
1161
+
ErrorPattern{pattern:"omc_explain_error requires",category:"introspection",explanation:"`omc_explain_error` arity mismatch.",typical_cause:"Wrong arg count.",fix:"Run `omc_help(\"omc_explain_error\")` for the signature."},
1162
+
ErrorPattern{pattern:"omc_code_canonical requires",category:"introspection",explanation:"`omc_code_canonical` arity mismatch.",typical_cause:"Wrong arg count.",fix:"Run `omc_help(\"omc_code_canonical\")` for the signature."},
1163
+
ErrorPattern{pattern:"omc_code_equivalent requires",category:"introspection",explanation:"`omc_code_equivalent` arity mismatch.",typical_cause:"Wrong arg count.",fix:"Run `omc_help(\"omc_code_equivalent\")` for the signature."},
1164
+
ErrorPattern{pattern:"omc_code_summary requires",category:"introspection",explanation:"`omc_code_summary` arity mismatch.",typical_cause:"Wrong arg count.",fix:"Run `omc_help(\"omc_code_summary\")` for the signature."},
1165
+
ErrorPattern{pattern:"omc_code_diff requires",category:"introspection",explanation:"`omc_code_diff` arity mismatch.",typical_cause:"Wrong arg count.",fix:"Run `omc_help(\"omc_code_diff\")` for the signature."},
1166
+
ErrorPattern{pattern:"omc_code_metrics requires",category:"introspection",explanation:"`omc_code_metrics` arity mismatch.",typical_cause:"Wrong arg count.",fix:"Run `omc_help(\"omc_code_metrics\")` for the signature."},
1167
+
ErrorPattern{pattern:"omc_remember requires",category:"introspection",explanation:"`omc_remember` arity mismatch.",typical_cause:"Wrong arg count.",fix:"Run `omc_help(\"omc_remember\")` for the signature."},
1168
+
ErrorPattern{pattern:"omc_recall_matches requires",category:"introspection",explanation:"`omc_recall_matches` arity mismatch.",typical_cause:"Wrong arg count.",fix:"Run `omc_help(\"omc_recall_matches\")` for the signature."},
1169
+
ErrorPattern{pattern:"omc_token_encode requires",category:"introspection",explanation:"`omc_token_encode` arity mismatch.",typical_cause:"Wrong arg count.",fix:"Run `omc_help(\"omc_token_encode\")` for the signature."},
1170
+
ErrorPattern{pattern:"omc_token_decode requires",category:"introspection",explanation:"`omc_token_decode` arity mismatch.",typical_cause:"Wrong arg count.",fix:"Run `omc_help(\"omc_token_decode\")` for the signature."},
1171
+
ErrorPattern{pattern:"omc_cheatsheet requires",category:"introspection",explanation:"`omc_cheatsheet` arity mismatch.",typical_cause:"Wrong arg count.",fix:"Run `omc_help(\"omc_cheatsheet\")` for the signature."},
1172
+
ErrorPattern{pattern:"omc_change_report requires",category:"introspection",explanation:"`omc_change_report` arity mismatch.",typical_cause:"Wrong arg count.",fix:"Run `omc_help(\"omc_change_report\")` for the signature."},
1173
+
ErrorPattern{pattern:"omc_id requires",category:"introspection",explanation:"`omc_id` arity mismatch.",typical_cause:"Wrong arg count.",fix:"Run `omc_help(\"omc_id\")` for the signature."},
1174
+
ErrorPattern{pattern:"omc_bootstrap_pack requires",category:"introspection",explanation:"`omc_bootstrap_pack` arity mismatch.",typical_cause:"Wrong arg count.",fix:"Run `omc_help(\"omc_bootstrap_pack\")` for the signature."},
1175
+
ErrorPattern{pattern:"omc_python_translation requires",category:"introspection",explanation:"`omc_python_translation` arity mismatch.",typical_cause:"Wrong arg count.",fix:"Run `omc_help(\"omc_python_translation\")` for the signature."},
1176
+
ErrorPattern{pattern:"omc_builtin_index_markdown requires",category:"introspection",explanation:"`omc_builtin_index_markdown` arity mismatch.",typical_cause:"Wrong arg count.",fix:"Run `omc_help(\"omc_builtin_index_markdown\")` for the signature."},
1177
+
ErrorPattern{pattern:"omc_search_builtins requires",category:"introspection",explanation:"`omc_search_builtins` arity mismatch.",typical_cause:"Wrong arg count.",fix:"Run `omc_help(\"omc_search_builtins\")` for the signature."},
1178
+
ErrorPattern{pattern:"omc_completion_hint requires",category:"introspection",explanation:"`omc_completion_hint` arity mismatch.",typical_cause:"Wrong arg count.",fix:"Run `omc_help(\"omc_completion_hint\")` for the signature."},
1179
+
ErrorPattern{pattern:"overflow shift",category:"math",explanation:"Shift exceeded i64 width.",typical_cause:"Shift count out of range.",fix:"Mask shift count to 0..63 via & 63."},
1180
+
ErrorPattern{pattern:"invalid base",category:"math",explanation:"parse_int with base outside 2..36.",typical_cause:"Wrong base.",fix:"Use base in [2, 36]."},
1181
+
ErrorPattern{pattern:"not a multiple",category:"math",explanation:"Requires divisibility but input isn't a multiple.",typical_cause:"Bad input.",fix:"Use modular arithmetic or pad input."},
1123
1182
];
1124
1183
1125
1184
/// Best-matching pattern for an error message. Returns None if no
0 commit comments