mirror of
https://github.com/Ed94/pikuma_ps1.git
synced 2026-08-16 14:11:33 +00:00
messing around.
This commit is contained in:
Binary file not shown.
@@ -4,7 +4,7 @@
|
|||||||
"semanticHighlighting": true,
|
"semanticHighlighting": true,
|
||||||
"colors": {
|
"colors": {
|
||||||
"editor.background": "#121212",
|
"editor.background": "#121212",
|
||||||
"editor.foreground": "#D25A6EFF",
|
"editor.foreground": "#c6b2a3",
|
||||||
"editor.lineHighlightBackground": "#1c1c1c",
|
"editor.lineHighlightBackground": "#1c1c1c",
|
||||||
"editor.selectionBackground": "#164371",
|
"editor.selectionBackground": "#164371",
|
||||||
"editor.selectionForeground": "#c8c8c8",
|
"editor.selectionForeground": "#c8c8c8",
|
||||||
@@ -15,12 +15,12 @@
|
|||||||
"editorRuler.foreground": "#505050",
|
"editorRuler.foreground": "#505050",
|
||||||
"editorGutter.background": "#121212",
|
"editorGutter.background": "#121212",
|
||||||
"editorBracketMatch.background": "#3b514d",
|
"editorBracketMatch.background": "#3b514d",
|
||||||
"editor.foldBackground": "#0c0c0c",
|
"editor.foldBackground": "#0c0c0c81",
|
||||||
"editor.wordHighlightBackground": "#121212",
|
"editor.wordHighlightBackground": "#1212124d",
|
||||||
"editor.wordHighlightStrongBackground": "#303030",
|
"editor.wordHighlightStrongBackground": "#303030",
|
||||||
"editorCursor.foreground": "#00fff4",
|
"editorCursor.foreground": "#00fff4",
|
||||||
"editorWhitespace.foreground": "#181818",
|
"editorWhitespace.foreground": "#181818",
|
||||||
"editorLineHighlightBorder": "#1c1c1c",
|
// "editorLineHighlightBorder": "#1c1c1c",
|
||||||
"editorWidget.background": "#121212",
|
"editorWidget.background": "#121212",
|
||||||
"editorSuggestWidget.background": "#2c334b",
|
"editorSuggestWidget.background": "#2c334b",
|
||||||
"editorHoverWidget.background": "#2c334b"
|
"editorHoverWidget.background": "#2c334b"
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
"keyword": { "foreground": "#d8bd5b" },
|
"keyword": { "foreground": "#d8bd5b" },
|
||||||
"string": { "foreground": "#d46a54" },
|
"string": { "foreground": "#d46a54" },
|
||||||
"number": { "foreground": "#b5cea8" },
|
"number": { "foreground": "#b5cea8" },
|
||||||
"operator": { "foreground": "#00ffff" },
|
"operator": { "foreground": "#54cfcf" },
|
||||||
"class": { "foreground": "#54a4d6" },
|
"class": { "foreground": "#54a4d6" },
|
||||||
"struct": { "foreground": "#54a4d6" },
|
"struct": { "foreground": "#54a4d6" },
|
||||||
"enum": { "foreground": "#54a4d6" },
|
"enum": { "foreground": "#54a4d6" },
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
"function": { "foreground": "#cccab5" },
|
"function": { "foreground": "#cccab5" },
|
||||||
"method": { "foreground": "#6090a9" },
|
"method": { "foreground": "#6090a9" },
|
||||||
"variable": { "foreground": "#bc966c" },
|
"variable": { "foreground": "#bc966c" },
|
||||||
"parameter": { "foreground": "#867660", "fontStyle": "underline" },
|
"parameter": { "foreground": "#867660" },
|
||||||
"property": { "foreground": "#acb8c8" },
|
"property": { "foreground": "#acb8c8" },
|
||||||
"*.static": { "foreground": "#9e95c6" },
|
"*.static": { "foreground": "#9e95c6" },
|
||||||
"macro": { "foreground": "#5ea852" },
|
"macro": { "foreground": "#5ea852" },
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
"tapeAnnotation": { "foreground": "#d8bd5b" },
|
"tapeAnnotation": { "foreground": "#d8bd5b" },
|
||||||
"tapeBindType": { "foreground": "#54a4d6" },
|
"tapeBindType": { "foreground": "#54a4d6" },
|
||||||
"tapePhase": { "foreground": "#b8d7a3", "fontStyle": "italic" },
|
"tapePhase": { "foreground": "#b8d7a3", "fontStyle": "italic" },
|
||||||
"tapeLabel": { "foreground": "#c8c8c8", "fontStyle": "bold" },
|
"tapeLabel": { "foreground": "#959595", "fontStyle": "bold" },
|
||||||
"tapeCpuInstruction": { "foreground": "#6090a9" },
|
"tapeCpuInstruction": { "foreground": "#6090a9" },
|
||||||
"tapeGteInstruction": { "foreground": "#9e95c6" },
|
"tapeGteInstruction": { "foreground": "#9e95c6" },
|
||||||
"tapeGpuInstruction": { "foreground": "#bf7dac" },
|
"tapeGpuInstruction": { "foreground": "#bf7dac" },
|
||||||
@@ -67,8 +67,8 @@
|
|||||||
"tapeGprRegister.tapeWrite": { "foreground": "#d68a36", "fontStyle": "bold" },
|
"tapeGprRegister.tapeWrite": { "foreground": "#d68a36", "fontStyle": "bold" },
|
||||||
"tapeCop2Register.tapeRead": { "foreground": "#a373b0", "fontStyle": "italic" },
|
"tapeCop2Register.tapeRead": { "foreground": "#a373b0", "fontStyle": "italic" },
|
||||||
"tapeCop2Register.tapeWrite": { "foreground": "#d46a54", "fontStyle": "bold" },
|
"tapeCop2Register.tapeWrite": { "foreground": "#d46a54", "fontStyle": "bold" },
|
||||||
"*.tapeAuto": { "fontStyle": "underline" },
|
// "*.tapeAuto": { },
|
||||||
"tapeControlFlow": { "foreground": "#76ff7d", "fontStyle": "bold" },
|
"tapeControlFlow": { "foreground": "#63d169", "fontStyle": "bold" },
|
||||||
"tapeDelaySlot": { "foreground": "#ff5647" }
|
"tapeDelaySlot": { "foreground": "#ff5647" }
|
||||||
},
|
},
|
||||||
"tokenColors": [
|
"tokenColors": [
|
||||||
|
|||||||
BIN
Binary file not shown.
+10
@@ -22,6 +22,7 @@ const TOKEN_TYPES = [
|
|||||||
"tapeCop2Register",
|
"tapeCop2Register",
|
||||||
"tapeDuffleType",
|
"tapeDuffleType",
|
||||||
"tapeAttribute",
|
"tapeAttribute",
|
||||||
|
"keyword",
|
||||||
];
|
];
|
||||||
|
|
||||||
const TOKEN_MODIFIERS = ["declaration", "tapeRead", "tapeWrite", "tapeAuto"];
|
const TOKEN_MODIFIERS = ["declaration", "tapeRead", "tapeWrite", "tapeAuto"];
|
||||||
@@ -36,6 +37,14 @@ const ANNOTATIONS = new Set([
|
|||||||
"atom_auto_reg", "phase_auto_reg", "atom_dbg_skip",
|
"atom_auto_reg", "phase_auto_reg", "atom_dbg_skip",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
const DSL_KEYWORDS = new Set([
|
||||||
|
"FI_", "I_", "NI_", "Relative_", "Struct_", "Enum_", "Union_",
|
||||||
|
"TypeR_", "TypeV_", "align_", "internal", "local_persist", "global",
|
||||||
|
"O_", "S_", "C_", "T_", "tmpl", "glue", "r_", "v_", "tr_", "tv_",
|
||||||
|
"rgcc", "rlit", "r_use", "r_set", "r_mod", "r_imm", "r_mem",
|
||||||
|
"enc_op", "enc_rs", "enc_rt", "enc_rd", "enc_imm", "enc_i", "enc_r",
|
||||||
|
]);
|
||||||
|
|
||||||
const DELAY_SLOT_KEYWORDS = new Set(["LdSlot_", "BdSlot_"]);
|
const DELAY_SLOT_KEYWORDS = new Set(["LdSlot_", "BdSlot_"]);
|
||||||
|
|
||||||
const CONTROL_FLOW_PREFIXES = /^(?:branch_|jump_|call_)/;
|
const CONTROL_FLOW_PREFIXES = /^(?:branch_|jump_|call_)/;
|
||||||
@@ -151,6 +160,7 @@ function classifyDocument(source, filePath, workspaceIndex, shouldCancel = () =>
|
|||||||
|
|
||||||
if (!type && index.bindTypes.has(token.text)) type = "tapeBindType";
|
if (!type && index.bindTypes.has(token.text)) type = "tapeBindType";
|
||||||
if (!type && index.types.has(token.text)) type = "tapeDuffleType";
|
if (!type && index.types.has(token.text)) type = "tapeDuffleType";
|
||||||
|
if (!type && DSL_KEYWORDS.has(token.text)) type = "keyword";
|
||||||
if (!type && index.attributes.has(token.text)) type = "tapeAttribute";
|
if (!type && index.attributes.has(token.text)) type = "tapeAttribute";
|
||||||
if (!type) type = registerType(token.text, index);
|
if (!type) type = registerType(token.text, index);
|
||||||
if (!type && DELAY_SLOT_KEYWORDS.has(token.text)) type = "tapeDelaySlot";
|
if (!type && DELAY_SLOT_KEYWORDS.has(token.text)) type = "tapeDelaySlot";
|
||||||
|
|||||||
+9
-7
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name": "tape-atom-syntax",
|
"name": "atomasm-psx",
|
||||||
"displayName": "Tape Atom DSL",
|
"displayName": "AtomAsm-PSX",
|
||||||
"description": "Source-derived semantic highlighting for the Tape/Atom MIPS macro DSL",
|
"description": "Semantic highlighting for the PS1 Tape/Atom MIPS macro DSL",
|
||||||
"publisher": "local",
|
"publisher": "local",
|
||||||
"version": "0.2.0",
|
"version": "0.3.0",
|
||||||
"engines": { "vscode": "^1.80.0" },
|
"engines": { "vscode": "^1.80.0" },
|
||||||
"categories": ["Programming Languages"],
|
"categories": ["Programming Languages"],
|
||||||
"activationEvents": ["onLanguage:c", "onLanguage:cpp"],
|
"activationEvents": ["onLanguage:c", "onLanguage:cpp"],
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "node --test test/*.test.js",
|
"test": "node --test test/*.test.js",
|
||||||
"package": "npx --yes @vscode/vsce@3.6.1 package --allow-missing-repository --skip-license --out tape-atom-syntax-0.2.0.vsix"
|
"package": "npx --yes @vscode/vsce@3.6.1 package --allow-missing-repository --skip-license --out atomasm-psx-0.3.0.vsix"
|
||||||
},
|
},
|
||||||
"contributes": {
|
"contributes": {
|
||||||
"semanticTokenTypes": [
|
"semanticTokenTypes": [
|
||||||
@@ -38,7 +38,8 @@
|
|||||||
{ "id": "tapeGprRegister", "superType": "variable", "description": "MIPS GPR alias" },
|
{ "id": "tapeGprRegister", "superType": "variable", "description": "MIPS GPR alias" },
|
||||||
{ "id": "tapeCop2Register", "superType": "variable", "description": "COP2 data or control register alias" },
|
{ "id": "tapeCop2Register", "superType": "variable", "description": "COP2 data or control register alias" },
|
||||||
{ "id": "tapeDuffleType", "superType": "type", "description": "Duffle type or type constructor" },
|
{ "id": "tapeDuffleType", "superType": "type", "description": "Duffle type or type constructor" },
|
||||||
{ "id": "tapeAttribute", "superType": "keyword", "description": "Duffle linkage or storage attribute" }
|
{ "id": "tapeAttribute", "superType": "keyword", "description": "Duffle linkage or storage attribute" },
|
||||||
|
{ "id": "keyword", "description": "Standard keyword (DSL built-in macros)" }
|
||||||
],
|
],
|
||||||
"semanticTokenModifiers": [
|
"semanticTokenModifiers": [
|
||||||
{ "id": "tapeRead", "description": "Register declared in atom_reads" },
|
{ "id": "tapeRead", "description": "Register declared in atom_reads" },
|
||||||
@@ -66,7 +67,8 @@
|
|||||||
"tapeGprRegister": ["variable.other.constant.duffle.gpr"],
|
"tapeGprRegister": ["variable.other.constant.duffle.gpr"],
|
||||||
"tapeCop2Register": ["variable.other.constant.duffle.cop2"],
|
"tapeCop2Register": ["variable.other.constant.duffle.cop2"],
|
||||||
"tapeDuffleType": ["storage.type.duffle.type"],
|
"tapeDuffleType": ["storage.type.duffle.type"],
|
||||||
"tapeAttribute": ["storage.modifier.duffle.attr"]
|
"tapeAttribute": ["storage.modifier.duffle.attr"],
|
||||||
|
"keyword": ["keyword"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
+3
@@ -11,6 +11,9 @@ const BASE_TYPES = [
|
|||||||
const BASE_ATTRIBUTES = [
|
const BASE_ATTRIBUTES = [
|
||||||
"FI_", "I_", "NI_", "Relative_", "Struct_", "Enum_", "Union_",
|
"FI_", "I_", "NI_", "Relative_", "Struct_", "Enum_", "Union_",
|
||||||
"TypeR_", "TypeV_", "align_", "internal", "local_persist", "global",
|
"TypeR_", "TypeV_", "align_", "internal", "local_persist", "global",
|
||||||
|
"O_", "S_", "C_", "T_", "tmpl", "glue", "r_", "v_", "tr_", "tv_",
|
||||||
|
"rgcc", "rlit", "r_use", "r_set", "r_mod", "r_imm", "r_mem",
|
||||||
|
"enc_op", "enc_rs", "enc_rt", "enc_rd", "enc_imm", "enc_i", "enc_r",
|
||||||
];
|
];
|
||||||
|
|
||||||
function createIndex() {
|
function createIndex() {
|
||||||
|
|||||||
@@ -64,8 +64,8 @@
|
|||||||
"name": "storage.type.duffle.type"
|
"name": "storage.type.duffle.type"
|
||||||
},
|
},
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"match": "\\b(?:FI_|I_|NI_|Relative_|align_|internal|local_persist|global)\\b",
|
"match": "\\b(?:FI_|I_|NI_|Relative_|align_|internal|local_persist|global|O_|S_|C_|T_|tmpl|glue|r_|v_|tr_|tv_|rgcc|rlit|r_use|r_set|r_mod|r_imm|r_mem|enc_op|enc_rs|enc_rt|enc_rd|enc_imm|enc_i|enc_r)\\b",
|
||||||
"name": "storage.modifier.duffle.attr"
|
"name": "keyword"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-5
@@ -31,7 +31,7 @@ test("package semantic legend matches classifier exports", () => {
|
|||||||
const contributedTypes = packageJson.contributes.semanticTokenTypes.map((entry) => entry.id);
|
const contributedTypes = packageJson.contributes.semanticTokenTypes.map((entry) => entry.id);
|
||||||
const contributedModifiers = packageJson.contributes.semanticTokenModifiers.map((entry) => entry.id);
|
const contributedModifiers = packageJson.contributes.semanticTokenModifiers.map((entry) => entry.id);
|
||||||
|
|
||||||
assert.equal(packageJson.version, "0.2.0");
|
assert.equal(packageJson.version, "0.3.0");
|
||||||
assert.deepEqual(contributedTypes, TOKEN_TYPES);
|
assert.deepEqual(contributedTypes, TOKEN_TYPES);
|
||||||
assert.deepEqual(contributedModifiers, TOKEN_MODIFIERS.filter((name) => name !== "declaration"));
|
assert.deepEqual(contributedModifiers, TOKEN_MODIFIERS.filter((name) => name !== "declaration"));
|
||||||
});
|
});
|
||||||
@@ -59,7 +59,7 @@ test("every semantic token has a scope mapping; DSL-specific tokens also have gr
|
|||||||
const grammarRequired = new Set([
|
const grammarRequired = new Set([
|
||||||
"tapeAtomKeyword", "tapeAtomName", "tapeComponentKeyword", "tapeComponentName",
|
"tapeAtomKeyword", "tapeAtomName", "tapeComponentKeyword", "tapeComponentName",
|
||||||
"tapeAnnotation", "tapeBindType", "tapePhase", "tapeLabel",
|
"tapeAnnotation", "tapeBindType", "tapePhase", "tapeLabel",
|
||||||
"tapeDelaySlot", "tapeDuffleType", "tapeAttribute",
|
"tapeDelaySlot", "tapeDuffleType", "keyword",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
for (const tokenType of TOKEN_TYPES) {
|
for (const tokenType of TOKEN_TYPES) {
|
||||||
@@ -84,8 +84,5 @@ test("TextMate offset labels stay scoped to atom_offset calls", () => {
|
|||||||
|
|
||||||
test("workspace enables semantic highlighting", () => {
|
test("workspace enables semantic highlighting", () => {
|
||||||
const settings = readJson(path.resolve(ROOT, "..", "settings.json"));
|
const settings = readJson(path.resolve(ROOT, "..", "settings.json"));
|
||||||
|
|
||||||
assert.equal(settings["editor.semanticHighlighting.enabled"], true);
|
assert.equal(settings["editor.semanticHighlighting.enabled"], true);
|
||||||
const semantic = settings["editor.semanticTokenColorCustomizations"];
|
|
||||||
assert.equal(semantic.enabled, true);
|
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user