Skip to content

compilers/compile: own the identifier grammar shared by every compiler #162

Description

@OmarAlJarrah

Every compiler derives IR identifiers, and all three currently do it independently: ids.go exists
in compilers/openapi, in the GraphQL draft (#20), and in the Protobuf draft (#21). What they must
agree on is the grammar — the t/..., op/..., p/... prefixes, and the rule that a minted node
occupies a namespace no source pointer can produce (invariant 3's corollary).

What they must not share is the derivation: a JSON Pointer, a GraphQL path and a protobuf
fully-qualified name are different things and stay in their own compilers.

What to do

Move the grammar and the namespace rule into compilers/compile. Leave OpenAPI pointer arithmetic
and the pointer-to-ID derivation in compilers/openapi.

Acceptance

compilers/openapi derives no identifier except through the framework, and golden output is
byte-identical — this is a move, not a behaviour change.

Part of docs/micro-compiler-design.md §3, and half of #73.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions