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

Commit

Permalink
Highlight spans in MIR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrubeck committed Mar 31, 2017
1 parent a084a07 commit 4bd70fa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions static/web.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@
};

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

function formatMir(text) {
return text.replace(/&lt;anon&gt;:(\d+):(\d+):\s+(\d+):(\d+)/mg, jumpToRegion);
}

addEventListener("DOMContentLoaded", function() {
evaluateButton = document.getElementById("evaluate");
asmButton = document.getElementById("asm");
Expand Down

0 comments on commit 4bd70fa

Please sign in to comment.