From b8ff1838086b148ddf75f397f6267e4489efff46 Mon Sep 17 00:00:00 2001 From: Daan Vanden Bosch Date: Fri, 16 Aug 2019 20:26:37 +0200 Subject: [PATCH] Somewhat improved parameter hint signatures. --- .../scripting/AssemblyAnalyser.ts | 27 ++++++++++++++++++- src/quest_editor/scripting/opcodes.ts | 4 +-- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/src/quest_editor/scripting/AssemblyAnalyser.ts b/src/quest_editor/scripting/AssemblyAnalyser.ts index b89a6ad2..24315e02 100644 --- a/src/quest_editor/scripting/AssemblyAnalyser.ts +++ b/src/quest_editor/scripting/AssemblyAnalyser.ts @@ -158,7 +158,32 @@ export class AssemblyAnalyser { signature += ", "; } - const param_name = Kind[param.type.kind]; + let param_name: string; + + switch (param.type.kind) { + case Kind.ILabel: + param_name = "FuncLabel"; + break; + case Kind.DLabel: + param_name = "DataLabel"; + break; + case Kind.SLabel: + param_name = "StringLabel"; + break; + case Kind.ILabelVar: + param_name = "...FuncLabel"; + break; + case Kind.RegRef: + case Kind.RegTupRef: + param_name = "Register"; + break; + case Kind.RegRefVar: + param_name = "...Register"; + break; + default: + param_name = Kind[param.type.kind]; + break; + } parameters.push({ label: [signature.length, signature.length + param_name.length], diff --git a/src/quest_editor/scripting/opcodes.ts b/src/quest_editor/scripting/opcodes.ts index b2b74488..d1d6a5b1 100644 --- a/src/quest_editor/scripting/opcodes.ts +++ b/src/quest_editor/scripting/opcodes.ts @@ -203,7 +203,7 @@ export const OPCODES: Opcode[] = []; export const OPCODES_BY_MNEMONIC = new Map(); /** - * Opcode for script object code. Invoked by {@link ../bin/Instruction}s. + * Opcode for script object code. Invoked by {@link Instruction}s. */ export class Opcode { /** @@ -211,7 +211,7 @@ export class Opcode { */ readonly code: number; /** - * String representation of this opcde as used in assembly. + * String representation of this opcode as used in assembly. */ readonly mnemonic: string; /**