Repository navigation
Ten declaration words are keywords only where their construct can begin; spawn is not reserved (closes #3132) - #3628
Merged
Merged
Conversation
added 7 commits
November 26, 2026 01:42
…in; spawn is a name (#3132)
…d; spec v7.92, D236 (delegated)
…st the spec's list; the spawn token is retired
… keywords; C names that are contextual words keep their names; tests follow
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3132, as Eric ruled on 2026-11-25 (D235): the ten words become contextual,
spawnis dropped,typestays reserved. The words in §29.11 are delegated (D98, D236); spec v7.92.What changes for a program.
c_import dyn ephemeral extend gen global module opaque union whereandspawnare ordinary names wherever their construct cannot begin: a binding, a field, a parameter, a method (List.extendcan now be declared). A C field or function with one of those names keeps its C name (ev.module, notev.module_).How. One pass after tokenizing (
lexer_contextual_words): each word keeps its keyword token only in its position, so the parser is unchanged. The positions:genbeforefnor a function modifier;whereanddynbefore a name;extendbefore a name, or type parameters and a name;globalbefore a name orvar;moduleat the start of a line before a name;opaque,union,ephemeralin atype/enumdeclaration after the name, its]or its=;c_importbetweenuseand(. The lexer has the contextual words in their own table, and:spec-inventory-checkcompares it with the spec's list.A diagnostic fixed on the way. Two names side by side in a body (
foo work()) were reported as "file has bothfn mainand top-level executable statements". They are now reported where they are, which is what a mistyped declaration word now produces.Tests.
behav_3132_declaration_words_are_names(all eleven as names beside their keyword uses),err_two_names_side_by_side; four existing tests that pinned the old refusal or the underscored C names follow the ruling.Not in this PR. Importing a C field named
typeunder its own name (Eric's note on the issue): filed separately below.Evidence. Battery GREEN on 00a147c;
:release-checksgreen on the same commit (the corpus lanes tokenize with the new pass).