Skip to content

Commit 6a1bca5

Browse files
committed
Update comment syntax, setup panic hook
1 parent 5041926 commit 6a1bca5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

index.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
start: [
6969
{regex: /"(?:[^\\]|\\.)*?(?:"|$)/, token: "string"},
7070

71-
{regex: /(?:elif|else|fn|for|if|in|let|match|return|self|trait|type|var|while)\b/,
71+
{regex: /(?:elif|else|fn|for|if|in|let|match|return|self|trait|type|var|while|import)\b/,
7272
token: "keyword"},
7373

7474
{regex: /0x[a-f\d]+|[-+]?(?:\.\d+|\d+\.?\d*)(?:e[-+]?\d+)?/i,
@@ -80,12 +80,12 @@
8080
{regex: /[A-Z][a-zA-Z0-9_]*/,
8181
token: "type"},
8282

83-
{regex: /--.*/, token: "comment"},
83+
{regex: /#.*/, token: "comment"},
8484
],
8585

8686
meta: {
8787
dontIndentStates: ["comment"],
88-
lineComment: "--"
88+
lineComment: "#"
8989
}
9090
});
9191

@@ -134,15 +134,15 @@
134134
</script>
135135

136136
<script type="module">
137-
import init, { run } from './fir.js';
137+
import init, { run, setupPanicHook } from './fir.js';
138138

139139
await init();
140+
await setupPanicHook();
140141

141142
window.run = function(pgm, input) {
142143
try {
143144
run(pgm, input);
144145
} catch (err) {
145-
clearInterpreterOutput();
146146
addInterpreterOutput(err);
147147
addInterpreterOutput(err.stack);
148148
}

0 commit comments

Comments
 (0)