GP-5752 Fixed missing characters at the end of operands, for example closing parenthesis added in the base sleigh instruction constructor.

This commit is contained in:
emteere 2025-07-17 15:49:39 -04:00
parent 9ddc746e6f
commit 9979a6f9ec
6 changed files with 16 additions and 28 deletions

View file

@ -145,7 +145,7 @@ public interface InstructionAdapterFromPrototype extends TraceInstruction {
@Override @Override
default String getSeparator(int opIndex) { default String getSeparator(int opIndex) {
return getPrototype().getSeparator(opIndex, getInstructionContext()); return getPrototype().getSeparator(opIndex);
} }
@Override @Override

View file

@ -708,7 +708,7 @@ public class SleighInstructionPrototype implements InstructionPrototype {
} }
@Override @Override
public String getSeparator(int opIndex, InstructionContext context) { public String getSeparator(int opIndex) {
if (opIndex < 0 || opIndex > opresolve.length) { if (opIndex < 0 || opIndex > opresolve.length) {
return null; return null;
} }

View file

@ -550,7 +550,7 @@ public class PseudoInstruction extends PseudoCodeUnit implements Instruction, In
@Override @Override
public String getSeparator(int opIndex) { public String getSeparator(int opIndex) {
return instrProto.getSeparator(opIndex, this); return instrProto.getSeparator(opIndex);
} }
@Override @Override

View file

@ -349,18 +349,7 @@ public class InstructionDB extends CodeUnitDB implements Instruction, Instructio
@Override @Override
public String getSeparator(int opIndex) { public String getSeparator(int opIndex) {
return proto.getSeparator(opIndex);
if (opIndex < 0 || opIndex >= getNumOperands()) {
return null;
}
lock.acquire();
try {
return proto.getSeparator(opIndex, this);
}
finally {
lock.release();
}
} }
@Override @Override

View file

@ -194,10 +194,9 @@ public interface InstructionPrototype {
* The separator string for numOperands+1 are the characters after the last operand. * The separator string for numOperands+1 are the characters after the last operand.
* *
* @param opIndex valid values are 0 thru numOperands+1 * @param opIndex valid values are 0 thru numOperands+1
* @param context the instruction context
* @return separator string, or null if there is no string * @return separator string, or null if there is no string
*/ */
public String getSeparator(int opIndex, InstructionContext context); public String getSeparator(int opIndex);
/** /**
* Get a List of Objects that can be used to render an operands representation. * Get a List of Objects that can be used to render an operands representation.

View file

@ -176,7 +176,7 @@ public class InvalidPrototype implements InstructionPrototype, ParserContext {
} }
@Override @Override
public String getSeparator(int opIndex, InstructionContext context) { public String getSeparator(int opIndex) {
return null; return null;
} }