---
title: "규칙 3.4: 텍스트 구조와 이름, TypeShade 셰이더 언어 설계 규칙과 그 근거, 출처, 검증 방식"
description: "TypeShade 언어 설계 규칙 3.4(텍스트 구조와 이름)입니다. A local variable, parameter, module constant or module variable that collides with a GLSL ES 3.00…"
url: https://typeshade.dev/ko/reference/rules/3-4/
language: ko
---

# 규칙 3.4

3장, 텍스트 구조와 이름 테스트

A local variable, parameter, module constant or module variable that collides with a GLSL ES 3.00 identifier restriction must be renamed consistently by the GLSL writer; helper function renaming retains its existing behavior. A struct, field, override or binding whose GLSL spelling is reserved receives a planned GLSL spelling (Proposal 0070). The record of a binding or of an override carries that spelling as `emittedGlsl`, which equals `emitted` where the two spellings agree (Proposal 0151). The record of a struct or of a field carries `emitted` only (Proposal 0070, D3). No diagnostic is reported for such a name.

규칙 본문과 그 아래 항목은 설계 문서에 적힌 컴파일러 원문이라 한국어 페이지에서도 영어로 둡니다.

## 근거

GLSL’s variable spellings can change without changing source values. The remaining names belong to interface or host contracts; GLSL is the second target: its spelling leaves the WGSL name as authored, and a GLSL word no longer stops the GLSL emit.

## 출처

ANGLE at shader version 300, including the `gl_` prefix and `__` shape restrictions, and the shared `GLSL_ES300_RESERVED` authority.

## 검증 방식

테스트로 확인합니다. 테스트나 게이트 스크립트, CI 워크플로가 이 규칙을 가리키고, 아래 파일 가운데 하나라도 규칙을 더는 가리키지 않으면 추적 검사가 실패합니다.

컴파일러가 이 규칙을 적용하는 곳을 규칙이 직접 적은 내용입니다.

the GLSL spellings of the spelling plan (`planSpellings` in `src/core/spelling-plan.ts`), `sanitizeVariableNames` and `sanitizeReservedIdents` in `src/core/backends/glsl-sanitize.ts`, and `src/compiler/ts/reserved-names.test.ts`.

커밋 af54ddad5에서 이 규칙을 확인하는 파일입니다. 파일마다 규칙을 처음 가리키는 줄로 연결했습니다.

- [`src/compiler/ts/kernel-param-names.test.ts:2`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/kernel-param-names.test.ts#L2)
- [`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-sanitize.ts:22`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/backends/glsl-sanitize.ts#L22)
- [`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/glsl-name-written.test.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/glsl-name-written.test.ts#L1)
- [`src/core/passes/variable-names.ts:2`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/passes/variable-names.ts#L2)
- [`src/core/spelling-plan.ts:14`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/spelling-plan.ts#L14)

## 함께 보기

- [규칙 3.3](https://typeshade.dev/ko/reference/rules/3-3/) 테스트
- [규칙 3.5](https://typeshade.dev/ko/reference/rules/3-5/) 테스트
- [설계 규칙](https://typeshade.dev/ko/reference/rules/)
- [오류 코드](https://typeshade.dev/ko/reference/errors/)

## 소스

커밋 af54ddad5의 규칙 원문:

- [`docs/language-design.md:282`](https://github.com/typeshade/typeshade/blob/af54ddad5/docs/language-design.md#L282) (설계 문서)
- [`reqs/rules/RULE-0304.md`](https://github.com/typeshade/typeshade/blob/af54ddad5/reqs/rules/RULE-0304.md) (추적 항목)
