diff options
Diffstat (limited to 'lib/compilers')
-rw-r--r-- | lib/compilers/argument-parsers.ts | 6 | ||||
-rw-r--r-- | lib/compilers/clang.ts | 2 | ||||
-rw-r--r-- | lib/compilers/java.ts | 2 | ||||
-rw-r--r-- | lib/compilers/llvm-mos.ts | 4 | ||||
-rw-r--r-- | lib/compilers/pascal.ts | 18 | ||||
-rw-r--r-- | lib/compilers/ptxas.ts | 4 | ||||
-rw-r--r-- | lib/compilers/wine-vc.ts | 2 |
7 files changed, 20 insertions, 18 deletions
diff --git a/lib/compilers/argument-parsers.ts b/lib/compilers/argument-parsers.ts index 4d9fe5af8..1556ad09f 100644 --- a/lib/compilers/argument-parsers.ts +++ b/lib/compilers/argument-parsers.ts @@ -711,8 +711,8 @@ export class VCParser extends BaseParser { let col1; let col2; if (line.length > 39 && line[40] === '/') { - col1 = line.substr(0, 39); - col2 = line.substr(40); + col1 = line.substring(0, 39); + col2 = line.substring(40); } else { col1 = line; col2 = ''; @@ -923,7 +923,7 @@ export class TableGenParser extends BaseParser { } actions.push({ - name: action_match[1].substr(2) + ': ' + action_match[2], + name: action_match[1].substring(2) + ': ' + action_match[2], value: action_match[1], }); } diff --git a/lib/compilers/clang.ts b/lib/compilers/clang.ts index 3ebad0961..dab518bc7 100644 --- a/lib/compilers/clang.ts +++ b/lib/compilers/clang.ts @@ -216,7 +216,7 @@ export class ClangCompiler extends BaseCompiler { if (startOrEnd === '__START__') { prevStart = match.index + full.length + 1; } else { - devices[triple] = assembly.substr(prevStart, match.index - prevStart); + devices[triple] = assembly.substring(prevStart, match.index); } } return devices; diff --git a/lib/compilers/java.ts b/lib/compilers/java.ts index 8fea06be2..2555507f9 100644 --- a/lib/compilers/java.ts +++ b/lib/compilers/java.ts @@ -382,7 +382,7 @@ export class JavaCompiler extends BaseCompiler implements SimpleOutputFilenameCo if (lastIndex !== -1) { // Get "interesting" text after the LineNumbers table (header of next method/tail of file) // trimRight() because of trailing \r on Windows - textsBeforeMethod.push(codeAndLineNumberTable.substr(lastIndex).trimEnd()); + textsBeforeMethod.push(codeAndLineNumberTable.substring(lastIndex).trimEnd()); } if (currentSourceLine !== -1) { diff --git a/lib/compilers/llvm-mos.ts b/lib/compilers/llvm-mos.ts index 9ff68a784..026a0fe45 100644 --- a/lib/compilers/llvm-mos.ts +++ b/lib/compilers/llvm-mos.ts @@ -84,7 +84,7 @@ export class LLVMMOSCompiler extends ClangCompiler { if (this.compiler.exe.includes('nes')) { let nesFile = outputFilename; if (outputFilename.endsWith('.elf')) { - nesFile = outputFilename.substr(0, outputFilename.length - 4); + nesFile = outputFilename.substring(0, outputFilename.length - 4); } if (await utils.fileExists(nesFile)) { @@ -93,7 +93,7 @@ export class LLVMMOSCompiler extends ClangCompiler { } else if (this.compiler.exe.includes('c64')) { let prgFile = outputFilename; if (outputFilename.endsWith('.elf')) { - prgFile = outputFilename.substr(0, outputFilename.length - 4); + prgFile = outputFilename.substring(0, outputFilename.length - 4); } if (await utils.fileExists(prgFile)) { diff --git a/lib/compilers/pascal.ts b/lib/compilers/pascal.ts index c91ba6a8b..71fe03a01 100644 --- a/lib/compilers/pascal.ts +++ b/lib/compilers/pascal.ts @@ -132,10 +132,12 @@ export class FPCCompiler extends BaseCompiler { if (relevantAsmStartsAt !== -1) { const lastLinefeedBeforeStart = input.lastIndexOf('\n', relevantAsmStartsAt); if (lastLinefeedBeforeStart === -1) { - input = input.substr(0, input.indexOf('00000000004')) + '\n' + input.substr(relevantAsmStartsAt); + input = input.substring(0, input.indexOf('00000000004')) + '\n' + input.substring(relevantAsmStartsAt); } else { input = - input.substr(0, input.indexOf('00000000004')) + '\n' + input.substr(lastLinefeedBeforeStart + 1); + input.substring(0, input.indexOf('00000000004')) + + '\n' + + input.substring(lastLinefeedBeforeStart + 1); } } return input; @@ -229,14 +231,14 @@ export class FPCCompiler extends BaseCompiler { getExtraAsmHint(asm: string, currentFileId: number) { if (asm.startsWith('# [')) { const bracketEndPos = asm.indexOf(']', 3); - let valueInBrackets = asm.substr(3, bracketEndPos - 3); + let valueInBrackets = asm.substring(3, bracketEndPos); const colonPos = valueInBrackets.indexOf(':'); if (colonPos !== -1) { - valueInBrackets = valueInBrackets.substr(0, colonPos - 1); + valueInBrackets = valueInBrackets.substring(0, colonPos - 1); } if (valueInBrackets.startsWith('/')) { - valueInBrackets = valueInBrackets.substr(1); + valueInBrackets = valueInBrackets.substring(1); } if (Number.isNaN(Number(valueInBrackets))) { @@ -254,14 +256,14 @@ export class FPCCompiler extends BaseCompiler { tryGetFilenumber(asm: string, files: Record<string, number>) { if (asm.startsWith('# [')) { const bracketEndPos = asm.indexOf(']', 3); - let valueInBrackets = asm.substr(3, bracketEndPos - 3); + let valueInBrackets = asm.substring(3, bracketEndPos); const colonPos = valueInBrackets.indexOf(':'); if (colonPos !== -1) { - valueInBrackets = valueInBrackets.substr(0, colonPos - 1); + valueInBrackets = valueInBrackets.substring(0, colonPos - 1); } if (valueInBrackets.startsWith('/')) { - valueInBrackets = valueInBrackets.substr(1); + valueInBrackets = valueInBrackets.substring(1); } if (Number.isNaN(Number(valueInBrackets))) { diff --git a/lib/compilers/ptxas.ts b/lib/compilers/ptxas.ts index 40157ded0..9302dccd6 100644 --- a/lib/compilers/ptxas.ts +++ b/lib/compilers/ptxas.ts @@ -54,8 +54,8 @@ export class PtxAssembler extends BaseCompiler { line = line.split(inputFilename).join('<source>'); if (inputFilename.indexOf('./') === 0) { - line = line.split('/home/ubuntu/' + inputFilename.substr(2)).join('<source>'); - line = line.split('/home/ce/' + inputFilename.substr(2)).join('<source>'); + line = line.split('/home/ubuntu/' + inputFilename.substring(2)).join('<source>'); + line = line.split('/home/ce/' + inputFilename.substring(2)).join('<source>'); } } if (line !== null) { diff --git a/lib/compilers/wine-vc.ts b/lib/compilers/wine-vc.ts index 461085092..db4a3d72f 100644 --- a/lib/compilers/wine-vc.ts +++ b/lib/compilers/wine-vc.ts @@ -61,7 +61,7 @@ export class WineVcCompiler extends BaseCompiler { execOptions.customCwd = path.dirname(inputFilename); if (inputFilename.startsWith('Z:')) { - execOptions.customCwd = execOptions.customCwd.substr(2); + execOptions.customCwd = execOptions.customCwd.substring(2); } return await super.runCompiler(compiler, options, inputFilename, execOptions); |