Skip to content
This repository was archived by the owner on Jun 27, 2018. It is now read-only.

Commit 4bd70fa

Browse files
committed
Highlight spans in MIR comments
1 parent a084a07 commit 4bd70fa

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

static/web.js

+7
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@
131131
};
132132

133133
function rehighlight(pygmentized, language) {
134+
if (language == "mir") {
135+
pygmentized = formatMirScopes(pygmentized);
136+
}
134137
var mappings = PYGMENTS_TO_ACE_MAPPINGS[language];
135138
return pygmentized.replace(/<span class="([^"]*)">([^<]*)<\/span>/g, function() {
136139
var classes = mappings[arguments[1]];
@@ -595,6 +598,10 @@
595598
.replace(/&lt;anon&gt;:(\d+):(\d+)/mg, jumpToPoint); // new errors
596599
}
597600

601+
function formatMir(text) {
602+
return text.replace(/&lt;anon&gt;:(\d+):(\d+):\s+(\d+):(\d+)/mg, jumpToRegion);
603+
}
604+
598605
addEventListener("DOMContentLoaded", function() {
599606
evaluateButton = document.getElementById("evaluate");
600607
asmButton = document.getElementById("asm");

0 commit comments

Comments
 (0)