SWIM-ucf / SWIM

Simple Web Interface for eMulation
https://swim-ucf.github.io/SWIM/
GNU General Public License v3.0
8 stars 1 forks source link

Support syntax highlighting all instructions #72

Closed jerrettl closed 1 year ago

jerrettl commented 1 year ago

A new language needs to be defined within the Monaco editor's API.

Default MIPS definition: https://github.com/microsoft/monaco-editor/blob/main/src/basic-languages/mips/mips.ts

How you might import it in Rust: https://github.com/abesto/clox-rs/blob/main/web/src/monaco_lox.rs https://github.com/abesto/clox-rs/blob/main/web/js/loxMonarchTokensProvider.js (This is essentially copied from mips.ts.)

Written in Rust is just the language configuration, with the tokens and tokenizer provided in Javascript.