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

Allow specifying custom clause numbers #473

Merged
merged 3 commits into from
Jul 29, 2022

Conversation

nicolo-ribaudo
Copy link
Member

Some proposal authors prefer writing proposals using the same section numbers as ecma262, but it requires hacks.

This PR allows specifying a custom number="..." attribute for emu-clause nodes.

  • for nested clauses, you can only specify the last number segment: the first ones are always inherited from the parent clause
  • after a custom number, automatic numbering continues from that number and not from where it left. This means that <emu-clause /> <emu-clause number="8" /> <emu-clause /> gives 1, 8, 9 and not 1, 8, 2 or 1, 8, 3.

cc @ljharb

@nicolo-ribaudo nicolo-ribaudo force-pushed the explicit-clause-numbers branch from 89bc17c to 66e852c Compare July 24, 2022 07:51
@ljharb
Copy link
Member

ljharb commented Jul 25, 2022

Yay!

@bakkot
Copy link
Contributor

bakkot commented Jul 29, 2022

Thanks! I pushed a commit adding support for nested numbers, as in number="1.1", as well as a few more warnings for error cases.

@bakkot bakkot merged commit 18538b5 into tc39:main Jul 29, 2022
@bakkot
Copy link
Contributor

bakkot commented Jul 29, 2022

Released in 14.1.0.

@nicolo-ribaudo nicolo-ribaudo deleted the explicit-clause-numbers branch July 31, 2022 07:08
@nicolo-ribaudo
Copy link
Member Author

Thank you!

@ljharb
Copy link
Member

ljharb commented Jul 31, 2022

This is great, and works perfectly! I’ve cleaned up 3 proposals so far.

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.

3 participants