---
title: "Rule 3.3: Textual structure and names in TypeShade"
description: "Rule 3.3 of the TypeShade language design, in Textual structure and names."
url: https://typeshade.dev/reference/rules/3-3/
language: en
---

# Rule 3.3

Chapter 3, Textual structure and names Test

A declaration named by a WGSL keyword or reserved word must receive a fresh WGSL spelling, with every reference rewritten, whatever its kind (Proposal 0070). The record names the spelling beside the authored name where the host reads it.

The rule text and the parts under it are the compiler's own English, as the design document writes them.

## Rationale

WGSL must contain no reserved identifier, while a legal TypeScript name can be represented without changing its value or authored identity.

## Derives from

WGSL’s keywords and reserved words, carried as `WGSL_RESERVED` in `src/core/reserved-words.ts`.

## How it is verified

Checked by a test. A test, a gate script or a CI workflow names this rule, and the traceability check fails when a file listed below stops naming it.

Where the rule says the compiler enforces it:

the spelling plan (`planSpellings` in `src/core/spelling-plan.ts`) and `spellModule` for module-scope names and entry parameters, `sanitizeVariableNames` through `wgslBackend` for locals and helper parameters, and `src/compiler/ts/reserved-names.test.ts` (surface §62).

The files that verify it at commit af54ddad5, each at the first line that names the rule:

- [`src/compiler/ts/kernel-param-names.test.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/kernel-param-names.test.ts#L1)
- [`src/compiler/ts/reserved-names.test.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/reserved-names.test.ts#L1)
- [`src/core/backends/glsl-spelling.test.ts:6`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/backends/glsl-spelling.test.ts#L6)
- [`src/core/backends/wgsl-spelling.test.ts:5`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/backends/wgsl-spelling.test.ts#L5)
- [`src/core/passes/spell-names.ts:2`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/passes/spell-names.ts#L2)
- [`src/core/passes/variable-names.ts:2`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/passes/variable-names.ts#L2)
- [`src/core/reserved-words.ts:11`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/reserved-words.ts#L11)
- [`src/core/spelling-plan.ts:14`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/spelling-plan.ts#L14)

## Explained in

The sections of the surface document that explain this rule, at commit af54ddad5:

- [§62 A name a target reserves](https://github.com/typeshade/typeshade/blob/af54ddad5/docs/use-typeshade-surface.md#62-a-name-a-target-reserves)

## See also

- [Rule 3.2](https://typeshade.dev/reference/rules/3-2/) Test
- [Rule 3.4](https://typeshade.dev/reference/rules/3-4/) Test
- [Design rules](https://typeshade.dev/reference/rules/)
- [Error codes](https://typeshade.dev/reference/errors/)

## Source

The rule at commit af54ddad5:

- [`docs/language-design.md:276`](https://github.com/typeshade/typeshade/blob/af54ddad5/docs/language-design.md#L276) (the design document)
- [`reqs/rules/RULE-0303.md`](https://github.com/typeshade/typeshade/blob/af54ddad5/reqs/rules/RULE-0303.md) (its traceability item)
