mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-08-10 17:55:44 +00:00
first and last var. subs. support
This commit is contained in:
parent
b5779cfda0
commit
3a8a3568bd
@ -93,7 +93,7 @@ public class ParseMSES1Ext1 extends ParseMSES1 {
|
||||
if(lower.startsWith("first ")) {
|
||||
if(line.length() <= 6) return EnumStatementReturn.PARAMETER_ERROR;
|
||||
try {
|
||||
int length = Integer.parseInt(line.substring(6));
|
||||
int length = Integer.parseInt(substitute(ctx, line.substring(6), true));
|
||||
int max = ctx.readBuffer().length();
|
||||
if(length > max) length = max;
|
||||
ctx.writeBuffer(ctx.readBuffer().substring(0, length));
|
||||
@ -105,7 +105,7 @@ public class ParseMSES1Ext1 extends ParseMSES1 {
|
||||
if(lower.startsWith("last ")) {
|
||||
if(line.length() <= 5) return EnumStatementReturn.PARAMETER_ERROR;
|
||||
try {
|
||||
int length = Integer.parseInt(line.substring(5));
|
||||
int length = Integer.parseInt(substitute(ctx, line.substring(5), true));
|
||||
int max = ctx.readBuffer().length();
|
||||
if(length > max) length = max;
|
||||
ctx.writeBuffer(ctx.readBuffer().substring(max - length, max));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user