Skip to content

Commit 480f6db

Browse files
committed
Match statement
1 parent 7267328 commit 480f6db

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2167,7 +2167,7 @@ match <object/expression>:
21672167
... parts=['/', 'home', user, *_]
21682168
... ) as p if p.name.lower().startswith('readme') and p.is_file():
21692169
... print(f'{p.name} is a readme file that belongs to user {user}.')
2170-
'README.md is a readme file that belongs to user gto.'
2170+
README.md is a readme file that belongs to user gto.
21712171
```
21722172

21732173

parse.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ const MATCH_EXAMPLE =
110110
'<span class="hljs-meta">... </span> parts=[<span class="hljs-string">\'/\'</span>, <span class="hljs-string">\'home\'</span>, user, *_]\n' +
111111
'<span class="hljs-meta">... </span> ) <span class="hljs-keyword">as</span> p <span class="hljs-keyword">if</span> p.name.lower().startswith(<span class="hljs-string">\'readme\'</span>) <span class="hljs-keyword">and</span> p.is_file():\n' +
112112
'<span class="hljs-meta">... </span> print(<span class="hljs-string">f\'<span class="hljs-subst">{p.name}</span> is a readme file that belongs to user <span class="hljs-subst">{user}</span>.\'</span>)\n' +
113-
'<span class="hljs-string">\'README.md is a readme file that belongs to user gto.\'</span>\n';
113+
'README.md is a readme file that belongs to user gto.\n';
114114

115115
const COROUTINES =
116116
'<span class="hljs-keyword">import</span> asyncio, collections, curses, curses.textpad, enum, random\n' +
@@ -733,7 +733,6 @@ function modifyPage() {
733733
unindentBanner();
734734
updateDiagrams();
735735
highlightCode();
736-
fixMatchHighlights();
737736
fixPandasDiagram();
738737
removePlotImages();
739738
fixABCSequenceDiv();
@@ -898,12 +897,6 @@ function insertPageBreakBefore(an_id) {
898897
$('<div class="pagebreak"></div>').insertBefore($(an_id).parent())
899898
}
900899

901-
function fixMatchHighlights() {
902-
const line = $(`span:contains(README.md is a readme file that belongs to user gto.)`);
903-
line.after('README.md is a readme file that belongs to user gto.');
904-
line.remove();
905-
}
906-
907900
function fixPandasDiagram() {
908901
const diagram_15 = '┏━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━┓';
909902
$(`code:contains(${diagram_15})`).find(".hljs-keyword:contains(and)").after("and");

0 commit comments

Comments
 (0)