Somewhat improved parameter hint signatures.

This commit is contained in:
Daan Vanden Bosch 2019-08-16 20:26:37 +02:00
parent e95513bb3c
commit b8ff183808
2 changed files with 28 additions and 3 deletions

View File

@ -158,7 +158,32 @@ export class AssemblyAnalyser {
signature += ", "; 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({ parameters.push({
label: [signature.length, signature.length + param_name.length], label: [signature.length, signature.length + param_name.length],

View File

@ -203,7 +203,7 @@ export const OPCODES: Opcode[] = [];
export const OPCODES_BY_MNEMONIC = new Map<string, Opcode>(); export const OPCODES_BY_MNEMONIC = new Map<string, Opcode>();
/** /**
* Opcode for script object code. Invoked by {@link ../bin/Instruction}s. * Opcode for script object code. Invoked by {@link Instruction}s.
*/ */
export class Opcode { export class Opcode {
/** /**
@ -211,7 +211,7 @@ export class Opcode {
*/ */
readonly code: number; readonly code: number;
/** /**
* String representation of this opcde as used in assembly. * String representation of this opcode as used in assembly.
*/ */
readonly mnemonic: string; readonly mnemonic: string;
/** /**