Error reference

internal

Raised by the Go engine only — the TypeScript runtime has no counterpart.

This code means two different things depending on where you read it. Both are below. Which one you have is settled by the shape of what you are holding: a parse diagnostic carries row, col and ruleStack; a C ABI reply is a JSON document whose top level is {"ok":false,"error":{…}}. They are not related events and share only a name.

Message

internal error: {src}

Hint

The parser failed unexpectedly; this is a bug in tabnas
or a plugin, not in your input.

{placeholders} are filled from the failing token and the details the grammar attached. The wording is informative and can change between releases — the code is the contract. This one is guaranteed by the Go runtime only: the TypeScript engine has no equivalent, so a cross-runtime check must not expect it.

In the C ABI

Returned by all 19 per-format shared libraries — the ABI is uniform, so every clib can return it.

It arrives as the whole reply, not inside a diagnostic:

{"ok":false,"error":{"code":"internal","message":"…"}}

This says your call was wrong, not your input. A library that read your input and decided it is outside the format replies {"ok":true,"accept":false} instead — a rejection is an answer, and it carries no code from this namespace. If you are here because a parse "failed", check which of the two you actually got before treating it as an error.

The five-symbol ABI and its guarantees are in tabnas.h; the decision behind it is ADR-12 in the admin repository.

What to do with it

  1. Read the rest of the diagnostic: row/col point at the input, expected lists the tokens that would have matched, and ruleStack shows how the parser got there.
  2. Reproduce it on its own with tabnas diagnose --json, which prints the whole object.
  3. Work the grammar back from the failing alternate — the debug-parse skill is that procedure written out, and the errors guide covers raising good ones from your own grammar.
  1. First settle which internal you have — the steps above are for the diagnostic; these are for the library reply.
  2. Check the message beside the code: unlike a parse diagnostic it is not templated, and for a call-level failure it usually names the argument at fault.
  3. Confirm the call shape against tabnas.h. Lengths are explicit byte counts and buffers are not read as NUL-terminated strings; every returned char* must be released with tabnas_free, and every handle with tabnas_grammar_free.
  4. If you are writing the binding rather than using one, the four maintained loaders (Rust, Python, JVM, .NET) already implement this contract and are graded against every clib in the fleet.

Generated from the engine's error registry , and from the clib block of each descriptor that carries one. Engine 0.8.10.