Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for labeling steps #74

Merged
merged 2 commits into from
Jun 17, 2020
Merged

support for labeling steps #74

merged 2 commits into from
Jun 17, 2020

Conversation

bakkot
Copy link
Contributor

@bakkot bakkot commented Jun 16, 2020

This introduces the ability to label steps, towards a solution to tc39/ecmarkup#192.

Corresponding upstream ecmarkup PR at tc39/ecmarkup#217. Corresponding upstream ecma262 PRs at tc39/ecma262#2052.

The ecmarkup PR describes how this is intended to be used, and the ecma262 PR shows what that looks like for ecma262 master.

Fixes #56.

src/tokenizer.ts Outdated Show resolved Hide resolved
Copy link
Member

@michaelficarra michaelficarra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there some escape hatch that would allow us to write a step whose text begins with what looks like a label? It's not a big deal, but it would be nice.

@michaelficarra
Copy link
Member

Should we try to look for a label following an unordered list item so we can fail with a useful message instead of passing it through as text?

@michaelficarra
Copy link
Member

Actually, now that I think about it, it could be useful to label an unordered list item. For example, linking to the step via a URL fragment.

@bakkot
Copy link
Contributor Author

bakkot commented Jun 17, 2020

Actually, now that I think about it, it could be useful to label an unordered list item. For example, linking to the step via a URL fragment.

Sure, makes sense. Updated; want to take another look?

@bakkot bakkot merged commit 178c28f into master Jun 17, 2020
@bakkot bakkot deleted the step-labels branch June 17, 2020 06:31
@jmdyck
Copy link

jmdyck commented Jun 17, 2020

Is there some escape hatch that would allow us to write a step whose text begins with what looks like a label? It's not a big deal, but it would be nice.

In the ecma262 spec, I'm pretty sure there's no step-syntax currently in use that would allow a step to start with a left square bracket, so it's unclear what you'd need the escape hatch for.

(In practice, the vast majority of steps start with an uppercase letter. The only exceptions I can find are:

  • 3 occurrences of <emu-not-ref>Record</emu-not-ref> that ...
  • 2 steps in the definition of the ? shorthand that (unrealistically) start with ?
  • Step 14.a in RegExpBuiltinExec, which begins _e_ is an index into the _Input_ character list, which should probably extracted into a NOTE step.

)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for adding labels (ids) to steps
3 participants