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

Normative: New pattern matching design #295

Merged
merged 72 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
9445a6a
Normative: New pattern matching design
Jack-Works Sep 6, 2023
f7c99d3
fixup: [spec] `npm run build`
Jack-Works Sep 6, 2023
c57ccb6
fix: seperator is missing
Jack-Works Sep 13, 2023
b28cfec
fixup: [spec] `npm run build`
Jack-Works Sep 13, 2023
edee9ff
Add if pattern
Jack-Works Sep 19, 2023
c02760c
fixup: [spec] `npm run build`
Jack-Works Sep 19, 2023
2c5be06
Drop all old spec
Jack-Works Oct 28, 2023
970290a
Add editor's notes
Jack-Works Oct 29, 2023
2f25d73
ecmarkup: use --assets-dir flag
Jack-Works Oct 29, 2023
666a3d8
Add PrimitivePattern
Jack-Works Oct 29, 2023
a53e225
Add MemberExpressionPattern
Jack-Works Oct 29, 2023
40a2c3a
Add UnaryAlgebraicPattern
Jack-Works Oct 29, 2023
a9a6876
Add CombinedMatchPattern and parenthesized pattern
Jack-Works Oct 29, 2023
fb4717e
Add custom matcher
Jack-Works Oct 29, 2023
fc186d7
Add built-in matchers and class default matcher
Jack-Works Oct 29, 2023
b0b7fb5
Add receiver to InvokeCustomMatcher
Jack-Works Oct 31, 2023
9885a81
fixup: [spec] `npm run build`
Jack-Works Oct 31, 2023
28b8b62
Add weakly-hold semantics to [[ConstructedBy]]
Jack-Works Nov 1, 2023
021404e
fixup: [spec] `npm run build`
Jack-Works Nov 1, 2023
49b0ebc
Add Error subclass custom matchers
Jack-Works Nov 2, 2023
116ae4e
Add is expression
Jack-Works Nov 3, 2023
e6de7e4
fixup: [spec] `npm run build`
Jack-Works Nov 3, 2023
dc6ca21
Add IfPattern
Jack-Works Nov 3, 2023
ed57392
fixup: [spec] `npm run build`
Jack-Works Nov 3, 2023
2df6f73
Add RelationalPattern
Jack-Works Nov 3, 2023
ecc70a9
Add RegularExpressionPattern
Jack-Works Nov 3, 2023
2851562
Add void pattern
Jack-Works Nov 3, 2023
c080e7d
Add match expression
Jack-Works Nov 3, 2023
e2250b4
Add cover grammar for match expression
Jack-Works Nov 4, 2023
da5b654
Add match statement
Jack-Works Nov 4, 2023
fafd2c7
fixup: [spec] `npm run build`
Jack-Works Nov 13, 2023
0dc344d
Add ObjectPattern, ArrayPattern and ExtractorPattern
Jack-Works Nov 15, 2023
13f78f4
Change , to ; in match expr
Jack-Works Nov 15, 2023
07387bc
fix: RegExp.prototype[@@customMatcher]
Jack-Works Nov 15, 2023
633aaef
Allow a solo default clause
Jack-Works Nov 15, 2023
61e51b5
fix: RelationalPattern RHS
Jack-Works Nov 15, 2023
bbce518
Rename ListMatchPattern to MatchList
Jack-Works Nov 15, 2023
bc2b482
Adjust non-normative notes
Jack-Works Nov 15, 2023
b885677
Add in in RelationalPattern
Jack-Works Nov 15, 2023
5eacd97
Change RegExp.prototype [ @@customMatcher ] to call RegExp built-ins
Jack-Works Nov 15, 2023
6174d61
Add xref to non standard % usages
Jack-Works Nov 15, 2023
e6c5525
fixup: [spec] `npm run build`
Jack-Works Nov 15, 2023
4ca281e
Add let pattern non-normative
Jack-Works Nov 16, 2023
12fc144
Add RegExp named capture group bindings
Jack-Works Nov 17, 2023
fe9fa84
fixup: [spec] `npm run build`
Jack-Works Nov 17, 2023
773c1aa
Move match statement back
Jack-Works Nov 18, 2023
caee149
Add notes
Jack-Works Nov 18, 2023
f52419d
Remove trailing comma from rest property
Jack-Works Nov 18, 2023
cb84d73
update notes
Jack-Works Nov 20, 2023
b007e43
fix: typo
Jack-Works Nov 20, 2023
60b1c4e
fixup: [spec] `npm run build`
Jack-Works Nov 20, 2023
681ab0c
Normative: remove has production in relational pattern
Jack-Works Nov 21, 2023
03e2dc6
fixup: [spec] `npm run build`
Jack-Works Nov 21, 2023
d364de9
Normative: update PatternMatchingMemberExpression
Jack-Works Nov 22, 2023
a9a42dd
update notes
Jack-Works Nov 22, 2023
8771803
update notes
Jack-Works Nov 22, 2023
83283dc
Normative: add ToPropertyKeyCached
Jack-Works Nov 22, 2023
be64357
fixup: [spec] `npm run build`
Jack-Works Nov 22, 2023
86f2916
fix: typo
Jack-Works Nov 24, 2023
fdc6fea
Normative: expand RHS of relational pattern and add type check in ord…
Jack-Works Nov 25, 2023
984034f
fixup: [spec] `npm run build`
Jack-Works Nov 25, 2023
2853c4b
Remove MatchStatement
Jack-Works Dec 16, 2023
d8d906c
Move void to future
Jack-Works Dec 16, 2023
0398348
Let +x or -x match by SVZ, +0 or -0 by SV
Jack-Works Dec 16, 2023
1f499bc
fix: escape
Jack-Works Jan 21, 2024
d810b00
Editorial: update notes for void bindings
Jack-Works Jan 25, 2024
e7ce681
Editorial: fix bug in InvokeCustomMatcher
Jack-Works Jan 26, 2024
2094a01
Editorial: update link
Jack-Works Feb 13, 2024
ad3f8b8
Editorial: update notes
Jack-Works Mar 17, 2024
2d71b3c
fixup: [spec] `npm run build`
Jack-Works Mar 17, 2024
451c37a
merge main
Jack-Works Mar 19, 2024
98a1256
fixup: [spec] `npm run build`
Jack-Works Mar 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/IBMPlexMono-Bold-SlashedZero.woff2
Binary file not shown.
Binary file added assets/IBMPlexMono-BoldItalic-SlashedZero.woff2
Binary file not shown.
Binary file added assets/IBMPlexMono-Italic-SlashedZero.woff2
Binary file not shown.
Binary file added assets/IBMPlexMono-Regular-SlashedZero.woff2
Binary file not shown.
Binary file added assets/IBMPlexSans-Bold-SlashedZero.woff2
Binary file not shown.
Binary file added assets/IBMPlexSans-BoldItalic-SlashedZero.woff2
Binary file not shown.
Binary file added assets/IBMPlexSans-Italic-SlashedZero.woff2
Binary file not shown.
Binary file added assets/IBMPlexSans-Regular-SlashedZero.woff2
Binary file not shown.
Binary file added assets/IBMPlexSerif-Bold-SlashedZero.woff2
Binary file not shown.
Binary file added assets/IBMPlexSerif-BoldItalic-SlashedZero.woff2
Binary file not shown.
Binary file added assets/IBMPlexSerif-Italic-SlashedZero.woff2
Binary file not shown.
Binary file added assets/IBMPlexSerif-Regular-SlashedZero.woff2
Binary file not shown.
1,433 changes: 1,433 additions & 0 deletions assets/ecmarkup.css

Large diffs are not rendered by default.

1,553 changes: 1,553 additions & 0 deletions assets/ecmarkup.js

Large diffs are not rendered by default.

44 changes: 44 additions & 0 deletions assets/expand.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
const state = {
__folded: true,
get folded() {
try {
const v = localStorage.getItem("folded");
return v === "true" || v === null;
} catch {
return this.__folded;
}
},
set folded(val) {
this.__folded = val;
try {
localStorage.setItem("folded", val);
} catch {}
document.body.classList.toggle("folded", val);
},
};
state.folded = state.folded;

const button = document.querySelector("#expand");
button.addEventListener("click", () => {
state.folded = !state.folded;
if (state.folded) {
const old = scrollY;
location.hash = "";
scrollTo(0, old);
}
});

function onHashChange(event) {
const target = document.getElementById(location.hash.slice(1));
if (!target) return;
if (!state.folded) return;
for (const el of document.querySelectorAll(".fold")) {
if (el.contains(target)) {
state.folded = false;
target.scrollIntoView(true);
setExpand(false);
}
}
}
window.addEventListener("hashchange", onHashChange);
window.addEventListener("DOMContentLoaded", onHashChange);
6,967 changes: 3,224 additions & 3,743 deletions index.html

Large diffs are not rendered by default.

34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"private": true,
"name": "proposal-pattern-matching",
"description": "A repository for ECMAScript pattern matching proposals.",
"scripts": {
"start": "npm run build -- --watch",
"build": "SOURCE_DATE_EPOCH=$(git log -1 --pretty=\"format:%ct\" spec.emu) ecmarkup spec.emu index.html --load-biblio @tc39/ecma262-biblio --lint-spec"
},
"homepage": "https://github.com/tc39/proposal-pattern-matching#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/tc39/proposal-pattern-matching.git"
},
"license": "MIT",
"devDependencies": {
"@tc39/ecma262-biblio": "^2.1.2631",
"ecmarkup": "^17.1.1"
}
"private": true,
"name": "proposal-pattern-matching",
"description": "A repository for ECMAScript pattern matching proposals.",
"scripts": {
"start": "npm run build -- --watch",
"build": "SOURCE_DATE_EPOCH=$(git log -1 --pretty=\"format:%ct\" spec.emu) ecmarkup spec.emu index.html --load-biblio @tc39/ecma262-biblio --lint-spec --assets-dir assets --mark-effects"
},
"homepage": "https://github.com/tc39/proposal-pattern-matching#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/tc39/proposal-pattern-matching.git"
},
"license": "MIT",
"devDependencies": {
"@tc39/ecma262-biblio": "^2.1.2653",
"ecmarkup": "^18.0.0"
}
}
Loading