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

Commit ac799f6

Browse files
authored
Merge pull request #284 from mbrubeck/mir
Highlight spans in MIR comments
2 parents a084a07 + 4bd70fa commit ac799f6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

static/web.js

Lines changed: 7 additions & 0 deletions
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)