From d4e68e7ef414668f802134cc075166393fb65305 Mon Sep 17 00:00:00 2001 From: Tyler Wilding Date: Thu, 1 Jul 2021 17:55:53 -0400 Subject: [PATCH] tooling: Add some very basic IR2 Syntax Highlighting (#659) * add IR syntax highlighting * set the filterFileRegex properly! --- .gitignore | 1 - .vscode/settings.json | 207 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 207 insertions(+), 1 deletion(-) create mode 100644 .vscode/settings.json diff --git a/.gitignore b/.gitignore index 3b0bb4d9d..cd4b3d475 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,6 @@ cmake-build-debug/* build/* decompiler_out/* logs/* -.vscode/settings.json # for Nix diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..f6b26adec --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,207 @@ +{ + "files.associations": { + "*ir2.asm": "Plain Text", + ".gc": "lisp", + ".gs": "lisp", + ".gd": "lisp" + }, + "highlight.maxMatches": 50000, // Maximum number of matches to decorate per regex, in order not to crash the app with accidental cathastropic regexes + "highlight.regexes": { + "(\\.function.*)": { + "filterFileRegex": ".*ir2\\.asm", + "decorations": [ + { + "overviewRulerColor": "transparent", // TODO - fix this bug, it extends beyond the line match + "color": "#41f041", + "fontWeight": "bold" + } + ] + }, + "(INFO:.*)": { + "filterFileRegex": ".*ir2\\.asm", + "decorations": [ + { + "overviewRulerColor": "transparent", + "color": "yellow", + "fontWeight": "bold", + "filterFileRegex": ".*ir2\\.asm" + } + ] + }, + "(at op \\d+)": { + "filterFileRegex": ".*ir2\\.asm", + "decorations": [ + { + "overviewRulerColor": "transparent", + "color": "#4de0ff" + } + ] + }, + "(.*;; )(\\[\\s*\\d+\\])": { + "filterFileRegex": ".*ir2\\.asm", + "decorations": [ + {}, + { + "overviewRulerColor": "transparent", + "color": "#4de0ff" + } + ] + }, + "(lw.+, )(.+\\(s7\\))": { + "filterFileRegex": ".*ir2\\.asm", + "decorations": [ + {}, + { + "overviewRulerColor": "transparent", + "color": "magenta" + } + ] + }, + "(L\\d+)": { + "filterFileRegex": ".*ir2\\.asm", + "decorations": [ + { + "overviewRulerColor": "transparent", + "color": "#f0d541" + } + ] + }, + "(B\\d+:)": { + "filterFileRegex": ".*ir2\\.asm", + "decorations": [ + { + "overviewRulerColor": "transparent", + "color": "#f07341" + } + ] + }, + "(at)": { + "filterFileRegex": ".*ir2\\.asm", + "decorations": [ + { + "overviewRulerColor": "transparent", + "color": "red" + } + ] + }, + "(gp)": { + "filterFileRegex": ".*ir2\\.asm", + "decorations": [ + { + "overviewRulerColor": "transparent", + "color": "#64c5e3" + } + ] + }, + "(v0)": { + "filterFileRegex": ".*ir2\\.asm", + "decorations": [ + { + "overviewRulerColor": "transparent", + "color": "#c6c1e6" + } + ] + }, + "(v1)": { + "filterFileRegex": ".*ir2\\.asm", + "decorations": [ + { + "overviewRulerColor": "transparent", + "color": "#dae6be" + } + ] + }, + "(s6)": { + "filterFileRegex": ".*ir2\\.asm", + "decorations": [ + { + "overviewRulerColor": "transparent", + "color": "#41f0b0" + } + ] + }, + "(a0)": { + "filterFileRegex": ".*ir2\\.asm", + "decorations": [ + { + "overviewRulerColor": "transparent", + "color": "pink" + } + ] + }, + "(a1)": { + "filterFileRegex": ".*ir2\\.asm", + "decorations": [ + { + "overviewRulerColor": "transparent", + "color": "#e065bb" + } + ] + }, + "(a2)": { + "filterFileRegex": ".*ir2\\.asm", + "decorations": [ + { + "overviewRulerColor": "transparent", + "color": "#6dd1a6" + } + ] + }, + "(a3)": { + "filterFileRegex": ".*ir2\\.asm", + "decorations": [ + { + "overviewRulerColor": "transparent", + "color": "#bad192" + } + ] + }, + "(t0)": { + "filterFileRegex": ".*ir2\\.asm", + "decorations": [ + { + "overviewRulerColor": "transparent", + "color": "#b56b82" + } + ] + }, + "(t1)": { + "filterFileRegex": ".*ir2\\.asm", + "decorations": [ + { + "overviewRulerColor": "transparent", + "color": "#6d32ba" + } + ] + }, + "(t2)": { + "filterFileRegex": ".*ir2\\.asm", + "decorations": [ + { + "overviewRulerColor": "transparent", + "color": "#db9267" + } + ] + }, + "(t3)": { + "filterFileRegex": ".*ir2\\.asm", + "decorations": [ + { + "overviewRulerColor": "transparent", + "color": "#92db67" + } + ] + }, + "(WARN:.*)": { + "filterFileRegex": ".*ir2\\.asm", + "decorations": [ + { + "overviewRulerColor": "red", + "color": "red", + "fontWeight": "bold", + "filterFileRegex": ".*ir2\\.asm" + } + ] + } + } +}