speced / speced/respec

Defining quoted enum values should be supported

Open
#4,615 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
806
Forks
434
Avg merge
1d 21h
Merged PRs (30d)
32

Description

Description of problem

Given an enum with, say, the enum-value of "standard", it would be nice to support:

<pre class="idl">
enum Foo {
   "standard"
};
</pre>
<dfn>"standard"</dfn>

What happened (e.g., it crashed)?:

That's not supported (or doesn't work).

Expected behavior (e.g., it shouldn't crash):

It should be possible to support that, if the context is an enum.

Note that <dfn>""</dfn> is supported, so it follows that <dfn>"whatever"</dfn> should be supported too.

Contributor guide

Open the contributing guide

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

Locate the enum parsing and quoted-value handling in the JavaScript source, then inspect how the existing empty-string case is supported. Confirm the quoted enum example from the issue is accepted without affecting non-enum definitions, and add or update the relevant tests if the project has coverage for this parser behavior.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.