Skip to the content.

Validation and testing

After generating JSON

  1. Parse it as JSON (your tools). If it fails, fix the file — do not patch ReScripted.
  2. Mentally (or with a script) confirm every key from language_template.json still exists at the same path and type.
  3. name is real. extensions is like [".foo"], not [".<EXTENSION>"].
  4. custom only holds extra kinds, not a second schema.
  5. builtins.functions matches what you will bind.

You may Language::compile the text in a tiny C++ program. If that throws, the JSON is unusable.

After embedding

The user’s program must compile. Missing embed::symbol means the generated header was not on the include path.

After writing scripts

Minimum host test:

engine.add_language(Language::compile(json));
try {
  auto id = engine.load(example_source, "t", lang_name);
  engine.run(id);
  engine.unload(id);
} catch (const rescripted::Error& e) {
  // fail the test with e.what()
}

Cover:

ReScripted’s own tests live in tests/runtime_test.cpp in the library repo. Do not add the user’s language tests there.

Schema drift

If compile succeeds but the script “ignores” a feature (classes, imports), that is expected — see implemented-schema.md. Do not “fix” it by deleting template keys.

Format

Pretty-print JSON with 2-space indent. No trailing comments (not JSON). No NaN. Use null where the template uses null.