WebAssembly / WebAssembly/component-model

Unify wit's stance on trailing commas

Open
#586 4 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
WebAssembly
Stars
1.4k
Forks
130
Avg merge
2d 1h
Merged PRs (30d)
15

Description

These productions currently allow trailing commas:

  • Include with names list: include-names-list
  • Use lists: use-names-list
  • Record fields: record-fields
  • Flag fields: flags-fields
  • Variant cases: variant-cases
  • Enum cases: enum-cases
  • Tuple type list: tuple-list

And these disallow trailing commas:

  • Include with names list: include-names-list
  • Function parameters: named-type-list
  • Constant-length generic parameter types: option, result, future, stream, borrow

All of the cases that we currently disallow trailing commas can accept trailing commas without adding ambiguity. I agree with @tschneidereit's judgment and think we should allow trailing commas in all currently disallowed cases.

Split off from https://github.com/WebAssembly/component-model/pull/585

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Search the repository for the named grammar productions, especially named-type-list and the option, result, future, stream, and borrow cases. Update the currently disallowed productions to accept trailing commas consistently, then run the grammar or specification tests covering these productions and confirm all listed cases behave uniformly.

Written by the indexing model from the issue text.

Assessment

Tech stack
wasm
Domain
compilers
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.