Apply automatic fixes

This commit is contained in:
Mats Larsen
2025-02-01 00:52:44 +09:00
committed by Mats Jun Larsen
parent de1b454596
commit 3ee43bbff4
161 changed files with 781 additions and 865 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ import '../../static/global';
export function runFrontendTest(name: string) {
it(name, () => {
return cy.window().then(win => {
return cy.window().then(win => {
return win.compilerExplorerFrontendTesting.run(name);
});
});
+1 -1
View File
@@ -56,7 +56,7 @@ export async function addArtifactToResult(
}
export async function addHeaptrackResults(result: CompilationResult, dirPath?: string): Promise<void> {
let dirPathToUse: string = '';
let dirPathToUse = '';
if (dirPath) {
dirPathToUse = dirPath;
} else if (result.buildResult && result.buildResult.dirPath) {
+9 -8
View File
@@ -40,8 +40,6 @@ import {
BuildResult,
BuildStep,
BypassCache,
bypassCompilationCache,
bypassExecutionCache,
CacheKey,
CmakeCacheKey,
CompilationCacheKey,
@@ -53,6 +51,8 @@ import {
FiledataPair,
GccDumpOptions,
LibsAndOptions,
bypassCompilationCache,
bypassExecutionCache,
} from '../types/compilation/compilation.interfaces.js';
import {
CompilerOverrideOption,
@@ -89,8 +89,8 @@ import {CompilerArguments} from './compiler-arguments.js';
import {
BaseParser,
ClangCParser,
ClangirParser,
ClangParser,
ClangirParser,
GCCCParser,
GCCParser,
ICCParser,
@@ -214,7 +214,7 @@ export class BaseCompiler {
protected packager: Packager;
protected executionType: string;
protected sandboxType: string;
protected defaultRpathFlag: string = '-Wl,-rpath,';
protected defaultRpathFlag = '-Wl,-rpath,';
private static objdumpAndParseCounter = new PromClient.Counter({
name: 'ce_objdumpandparsetime_total',
help: 'Time spent on objdump and parsing of objdumps',
@@ -655,7 +655,7 @@ export class BaseCompiler {
if (this.externalparser) {
const objResult = await this.externalparser.objdumpAndParseAssembly(result.dirPath, args, filters);
if (objResult.parsingTime !== undefined) {
objResult.objdumpTime = parseInt(result.execTime) - parseInt(result.parsingTime);
objResult.objdumpTime = Number.parseInt(result.execTime) - Number.parseInt(result.parsingTime);
delete objResult.execTime;
}
@@ -2791,7 +2791,7 @@ export class BaseCompiler {
fullResult.code = 0;
if (fullResult.buildsteps) {
_.each(fullResult.buildsteps, function (step) {
_.each(fullResult.buildsteps, step => {
fullResult.code += step.code;
});
}
@@ -3079,7 +3079,8 @@ export class BaseCompiler {
result.filteredCount = res.filteredCount;
if (res.languageId) result.languageId = res.languageId;
if (result.objdumpTime) {
const dumpAndParseTime = parseInt(result.objdumpTime) + parseInt(result.parsingTime);
const dumpAndParseTime =
Number.parseInt(result.objdumpTime) + Number.parseInt(result.parsingTime);
BaseCompiler.objdumpAndParseCounter.inc(dumpAndParseTime);
}
} else {
@@ -3274,7 +3275,7 @@ export class BaseCompiler {
const versionMatch = versionRegex.exec(version);
if (versionMatch) {
const versionNum = parseFloat(versionMatch[1]);
const versionNum = Number.parseFloat(versionMatch[1]);
return version.toLowerCase().includes('clang') && versionNum >= 3.3;
}
+2 -2
View File
@@ -85,8 +85,8 @@ export class BinaryInfoLinux {
}
static removeComments(value: string): string {
let filtered: string = '';
let inComment: boolean = false;
let filtered = '';
let inComment = false;
for (const c of value) {
if (!inComment && c === '(') {
inComment = true;
+1 -1
View File
@@ -32,7 +32,7 @@ import {OnDiskCache} from './on-disk.js';
import {S3Cache} from './s3.js';
function paramInt(config: string, param: string): number {
const result = parseInt(param);
const result = Number.parseInt(param);
if (isNaN(result)) throw new Error(`Bad params: ${config}`);
return result;
}
+7 -4
View File
@@ -108,9 +108,12 @@ export class BaseCFGParser {
let rangeBb: BBRange = {nameId: functionName, start: first, end: 0, actionPos: []};
const result: BBRange[] = [];
const newRangeWith = function (oldRange: BBRange, nameId: string, start: number) {
return {nameId: nameId, start: start, actionPos: [], end: oldRange.end};
};
const newRangeWith = (oldRange: BBRange, nameId: string, start: number) => ({
nameId: nameId,
start: start,
actionPos: [],
end: oldRange.end,
});
while (first < last) {
const inst = asmArr[first].text;
@@ -250,7 +253,7 @@ export class BaseCFGParser {
return asm ? this.isBasicBlockEnd(asm.text, '') : false;
};
const generateName = function (name: string, suffix: number) {
const generateName = (name: string, suffix: number) => {
const pos = name.indexOf('@');
if (pos === -1) return `${name}@${suffix}`;
+1 -1
View File
@@ -83,7 +83,7 @@ export class LlvmIrCfgParser extends BaseCFGParser {
const result: BBRange[] = [];
let i = fn.start + 1;
let bbStart = i;
let currentName: string = '';
let currentName = '';
let namePrefix: string = fnName + '\n\n';
while (i < fn.end) {
const match = code[i].text.match(this.labelRe);
+7 -9
View File
@@ -28,7 +28,7 @@ import {EdgeColor} from '../../../types/compilation/cfg.interfaces.js';
import {logger} from '../../logger.js';
import {BaseInstructionSetInfo, InstructionType} from '../instruction-sets/base.js';
import {AssemblyLine, BaseCFGParser, BBRange, CanonicalBB, Edge, Range} from './base.js';
import {AssemblyLine, BBRange, BaseCFGParser, CanonicalBB, Edge, Range} from './base.js';
// This currently only covers the default arm64 output. To support dex2oat's
// other ISAs, we just need to make sure the correct isJmpInstruction() is being
@@ -153,14 +153,12 @@ export class OatCFGParser extends BaseCFGParser {
actionPos: [],
};
const newRangeWith = function (oldRange: BBRange, nameId: string, start: number) {
return {
nameId: nameId,
start: start,
actionPos: [],
end: oldRange.end,
};
};
const newRangeWith = (oldRange: BBRange, nameId: string, start: number) => ({
nameId: nameId,
start: start,
actionPos: [],
end: oldRange.end,
});
const result: BBRange[] = [];
while (first < last) {
+1 -1
View File
@@ -24,7 +24,7 @@
import type {CompilerInfo} from '../../types/compiler.interfaces.js';
import {AssemblyLine, Edge, getParserByKey, Node} from './cfg-parsers/index.js';
import {AssemblyLine, Edge, Node, getParserByKey} from './cfg-parsers/index.js';
import {OatCFGParser} from './cfg-parsers/oat.js';
import {getInstructionSetByKey} from './instruction-sets/index.js';
+4 -4
View File
@@ -25,10 +25,10 @@
import {InstructionSet} from '../../../types/instructionsets.js';
export enum InstructionType {
jmp,
conditionalJmpInst,
notRetInst,
retInst,
jmp = 0,
conditionalJmpInst = 1,
notRetInst = 2,
retInst = 3,
}
export class BaseInstructionSetInfo {
+1 -1
View File
@@ -121,7 +121,7 @@ export class ClientStateCompiler {
export class ClientStateExecutor {
compilerVisible = false;
compilerOutputVisible = false;
arguments: string = '';
arguments = '';
argumentsVisible = false;
stdin = '';
stdinVisible = false;
+1 -1
View File
@@ -39,7 +39,7 @@ import {FormattingService} from './formatting-service.js';
import {logger} from './logger.js';
import type {PropertyGetter} from './properties.interfaces.js';
import {CompilerProps, PropFunc} from './properties.js';
import {createStatsNoter, IStatsNoter} from './stats.js';
import {IStatsNoter, createStatsNoter} from './stats.js';
export class CompilationEnvironment {
ceProps: PropertyGetter;
+4 -4
View File
@@ -134,7 +134,7 @@ export class BaseParser {
}
static async getOptions(compiler: BaseCompiler, helpArg: string) {
const optionFinder1 = /^ *(--?[\d#+,<=>[\]a-z|-]* ?[\d+,<=>[\]a-z|-]*) +(.*)/i;
const optionFinder1 = /^ *(--?[\d#+,<=>[\]a-z|-]* ?[\d+,<=>[\]a-z|-]*) {2,}(.*)/i;
const optionFinder2 = /^ *(--?[\d#+,<=>[\]a-z|-]* ?[\d+,<=>[\]a-z|-]*)/i;
const result = await compiler.execCompilerCached(compiler.compiler.exe, [helpArg]);
const options =
@@ -243,7 +243,7 @@ export class GCCParser extends BaseParser {
}
static override async getOptions(compiler: BaseCompiler, helpArg: string) {
const optionFinder1 = /^ *(--?[\d#+,<=>[\]a-z|-]* ?[\d+,<=>[\]a-z|-]*) +(.*)/i;
const optionFinder1 = /^ *(--?[\d#+,<=>[\]a-z|-]* ?[\d+,<=>[\]a-z|-]*) {2,}(.*)/i;
const optionFinder2 = /^ *(--?[\d#+,<=>[\]a-z|-]* ?[\d+,<=>[\]a-z|-]*)/i;
const result = await compiler.execCompilerCached(compiler.compiler.exe, helpArg.split(' '));
const options =
@@ -496,7 +496,7 @@ export class ClangCParser extends ClangParser {
export class CircleParser extends ClangParser {
static override async getOptions(compiler: BaseCompiler, helpArg: string) {
const optionFinder1 = /^ +(--?[\w#,.<=>[\]|-]*) +- (.*)/i;
const optionFinder1 = /^ +(--?[\w#,.<=>[\]|-]*) {2,}- (.*)/i;
const optionFinder2 = /^ +(--?[\w#,.<=>[\]|-]*)/i;
const result = await compiler.execCompilerCached(compiler.compiler.exe, helpArg.split(' '));
const options = result.code === 0 ? this.parseLines(result.stdout, optionFinder1, optionFinder2) : {};
@@ -1270,7 +1270,7 @@ export class GlslangParser extends BaseParser {
}
static override async getOptions(compiler: BaseCompiler, helpArg: string) {
const optionFinder1 = /^ *(--?[\d#+,<=>[\]a-z|-]* ?[\d+,<=>[\]a-z|-]*) +(.*)/i;
const optionFinder1 = /^ *(--?[\d#+,<=>[\]a-z|-]* ?[\d+,<=>[\]a-z|-]*) {2,}(.*)/i;
const optionFinder2 = /^ *(--?[\d#+,<=>[\]a-z|-]* ?[\d+,<=>[\]a-z|-]*)/i;
const result = await compiler.execCompilerCached(compiler.compiler.exe, [helpArg]);
// glslang will return a return code of 1 when calling --help (since it means nothing was compiled)
+1 -1
View File
@@ -83,7 +83,7 @@ export class CarbonCompiler extends BaseCompiler {
// Hook to parse out the "result: 123" line at the end of the interpreted execution run.
const re = /^result: (\d+)$/;
const match = re.exec(this.lastLine(result.asm as ResultLine[]));
const code = match ? parseInt(match[1]) : -1;
const code = match ? Number.parseInt(match[1]) : -1;
result.execResult = {
stdout: result.stdout,
stderr: [],
+1 -1
View File
@@ -96,7 +96,7 @@ export class HookCompiler extends BaseCompiler {
}
const match = text.match(instructionRegex);
if (match) {
const lineNo = parseInt(match[1]);
const lineNo = Number.parseInt(match[1]);
item.source = {line: lineNo, file: null};
lastLineNo = lineNo;
continue;
+1 -1
View File
@@ -22,8 +22,8 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
import * as fs from 'fs/promises';
import Path from 'path';
import * as fs from 'fs/promises';
import Semver from 'semver';
import _ from 'underscore';
+1 -1
View File
@@ -22,8 +22,8 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
import * as fs from 'fs/promises';
import path from 'path';
import * as fs from 'fs/promises';
import {CompilationInfo, CompilationResult} from '../../types/compilation/compilation.interfaces.js';
import {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
+1 -4
View File
@@ -117,10 +117,7 @@ export class PascalWinCompiler extends BaseCompiler {
await fs.writeFile(
filename,
// prettier-ignore
'program prog;\n' +
'uses ' + unitName + ' in \'' + unitPath + '\';\n' +
'begin\n' +
'end.\n',
'program prog;\n' + 'uses ' + unitName + " in '" + unitPath + "';\n" + 'begin\n' + 'end.\n',
);
}
+2 -5
View File
@@ -196,10 +196,7 @@ export class FPCCompiler extends BaseCompiler {
await fs.writeFile(
filename,
// prettier-ignore
'program prog;\n' +
'uses ' + unitName + ' in \'' + unitPath + '\';\n' +
'begin\n' +
'end.\n',
'program prog;\n' + 'uses ' + unitName + " in '" + unitPath + "';\n" + 'begin\n' + 'end.\n',
);
}
@@ -324,7 +321,7 @@ export class FPCCompiler extends BaseCompiler {
if (Number.isNaN(Number(valueInBrackets))) {
if (!files[valueInBrackets]) {
let maxFileId = _.max(files);
if (maxFileId === -Infinity) {
if (maxFileId === Number.NEGATIVE_INFINITY) {
maxFileId = 0;
}
+2 -2
View File
@@ -49,7 +49,7 @@ export class PtxAssembler extends BaseCompiler {
parsePtxOutput(lines: string, inputFilename: string, pathPrefix: string) {
const re = /^ptxas\s*<source>, line (\d+);(.*)/;
const result: ResultLine[] = [];
utils.eachLine(lines, function (line) {
utils.eachLine(lines, line => {
if (pathPrefix) line = line.replace(pathPrefix, '');
if (inputFilename) {
line = line.split(inputFilename).join('<source>');
@@ -66,7 +66,7 @@ export class PtxAssembler extends BaseCompiler {
lineObj.text = `<source>:${match[1]} ${match[2].trim()}`;
lineObj.tag = {
severity: 0,
line: parseInt(match[1]),
line: Number.parseInt(match[1]),
column: 0,
text: match[2].trim(),
};
+1 -1
View File
@@ -60,7 +60,7 @@ export class PythonCompiler extends BaseCompiler {
const match = line.match(lineRe);
if (match) {
const lineno = parseInt(match[1]);
const lineno = Number.parseInt(match[1]);
sourceLoc = {line: lineno, file: null};
lastLineNo = lineno;
} else if (line) {
+2 -2
View File
@@ -64,12 +64,12 @@ export class RubyCompiler extends BaseCompiler {
const match = line.match(lineRe);
if (match) {
lastLineNo = parseInt(match[1]);
lastLineNo = Number.parseInt(match[1]);
} else if (line) {
const fileMatch = line.match(fileRe);
if (fileMatch) {
lastFile = fileMatch[1];
lastLineNo = parseInt(fileMatch[2]);
lastLineNo = Number.parseInt(fileMatch[2]);
}
} else {
lastFile = null;
+4 -4
View File
@@ -115,7 +115,7 @@ export class SolidityCompiler extends BaseCompiler {
return node.name === 'FunctionDefinition';
})
.map(node => {
const [begin, length] = node.src.split(':').map(x => parseInt(x));
const [begin, length] = node.src.split(':').map(x => Number.parseInt(x));
let name = node.attributes.isConstructor ? 'constructor' : node.attributes.name;
@@ -147,7 +147,7 @@ export class SolidityCompiler extends BaseCompiler {
return node.nodeType === 'FunctionDefinition';
})
.map(node => {
const [begin, length] = node.src.split(':').map(x => parseInt(x));
const [begin, length] = node.src.split(':').map(x => Number.parseInt(x));
let name = node.kind === 'constructor' ? 'constructor' : node.name;
@@ -179,7 +179,7 @@ export class SolidityCompiler extends BaseCompiler {
const generatedSources = {};
for (const generatedSource of generatedSourcesData) {
generatedSources[generatedSource.id] = generatedSource.ast.statements.map(statement => {
const [begin, length] = statement.src.split(':').map(x => parseInt(x));
const [begin, length] = statement.src.split(':').map(x => Number.parseInt(x));
return {
name: statement.name,
begin: begin,
@@ -276,7 +276,7 @@ export class SolidityCompiler extends BaseCompiler {
}),
];
})
.flat(Infinity),
.flat(Number.POSITIVE_INFINITY),
};
}
}
+1 -1
View File
@@ -1,3 +1,4 @@
import path from 'path';
// Copyright (c) 2024, Compiler Explorer Authors
// All rights reserved.
//
@@ -22,7 +23,6 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
import fs from 'fs/promises';
import path from 'path';
import {ExecutionOptionsWithEnv} from '../../types/compilation/compilation.interfaces.js';
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
+1 -1
View File
@@ -160,7 +160,7 @@ export class z88dkCompiler extends BaseCompiler {
if (this.externalparser) {
const objResult = await this.externalparser.objdumpAndParseAssembly(result.dirPath, args, filters);
if (objResult.parsingTime !== undefined) {
objResult.objdumpTime = parseInt(result.execTime) - parseInt(result.parsingTime);
objResult.objdumpTime = Number.parseInt(result.execTime) - Number.parseInt(result.parsingTime);
delete objResult.execTime;
}
+6 -6
View File
@@ -25,12 +25,12 @@
import {BaseDemangler} from './base.js';
const LabelMetadata = [
{ident: new RegExp('C1E[a-zA-Z0-9_$]*$'), description: 'complete object constructor'},
{ident: new RegExp('C2E[a-zA-Z0-9_$]*$'), description: 'base object constructor'},
{ident: new RegExp('C3E[a-zA-Z0-9_$]*$'), description: 'complete object allocating constructor'},
{ident: new RegExp('D0Ev$'), description: 'deleting destructor'},
{ident: new RegExp('D1Ev$'), description: 'complete object destructor'},
{ident: new RegExp('D2Ev$'), description: 'base object destructor'},
{ident: /C1E[a-zA-Z0-9_$]*$/, description: 'complete object constructor'},
{ident: /C2E[a-zA-Z0-9_$]*$/, description: 'base object constructor'},
{ident: /C3E[a-zA-Z0-9_$]*$/, description: 'complete object allocating constructor'},
{ident: /D0Ev$/, description: 'deleting destructor'},
{ident: /D1Ev$/, description: 'complete object destructor'},
{ident: /D2Ev$/, description: 'base object destructor'},
];
export class CppDemangler extends BaseDemangler {
+2 -2
View File
@@ -29,10 +29,10 @@ import {logger} from '../logger.js';
import {PropertyGetter} from '../properties.interfaces.js';
export class EventsWsBase {
protected expectClose: boolean = false;
protected expectClose = false;
protected events_url: string;
protected ws: WebSocket | undefined = undefined;
protected got_error: boolean = false;
protected got_error = false;
constructor(props: PropertyGetter) {
this.events_url = props<string>('execqueue.events_url', '');
-4
View File
@@ -31,7 +31,3 @@ declare global {
var handler_config: HandlerConfig;
/* eslint-enable no-var */
}
// Necessary because we're not exporting any actual symbols from this file
// See https://www.typescriptlang.org/docs/handbook/declaration-files/templates/global-modifying-module-d-ts.html
export {};
+1 -1
View File
@@ -105,7 +105,7 @@ export class RouteAPI {
storedCodeHandler(req: express.Request, res: express.Response, next: express.NextFunction) {
const id = req.params.id;
const sessionid = parseInt(req.params.session);
const sessionid = Number.parseInt(req.params.session);
this.storageHandler
.expandId(id)
.then(result => {
+1 -1
View File
@@ -141,7 +141,7 @@ export class LlvmAstParser {
const addressRegex = /^([^A-Za-z]*[A-Za-z]+) 0x[\da-z]+/gm;
const slocRegex2 = / ?<?<invalid sloc>>?/g;
let mostRecentIsSource: boolean = false;
let mostRecentIsSource = false;
const isBlockUserSource = (output: ResultLine[], start: number, mostRecentIsSource: boolean) => {
for (let i = start + 1; i < output.length; ++i) {
+6 -6
View File
@@ -43,13 +43,13 @@ export class MapFileReaderDelphi extends MapFileReader {
*/
override tryReadingCodeSegmentInfo(line: string) {
let matches = line.match(this.regexDelphiCodeSegmentOffset);
if (matches && !matches[4].includes('$') && parseInt(matches[2], 16) >= this.preferredLoadAddress) {
const addressWithOffset = parseInt(matches[2], 16);
if (matches && !matches[4].includes('$') && Number.parseInt(matches[2], 16) >= this.preferredLoadAddress) {
const addressWithOffset = Number.parseInt(matches[2], 16);
this.segmentOffsets.push({
segment: matches[1],
addressInt: addressWithOffset,
address: addressWithOffset.toString(16),
segmentLength: parseInt(matches[3], 16),
segmentLength: Number.parseInt(matches[3], 16),
});
} else {
matches = line.match(this.regexDelphiCodeSegment);
@@ -57,7 +57,7 @@ export class MapFileReaderDelphi extends MapFileReader {
this.segments.push({
...this.addressToObject(matches[1], matches[2]),
id: this.segments.length + 1,
segmentLength: parseInt(matches[3], 16),
segmentLength: Number.parseInt(matches[3], 16),
unitName: matches[4] === 'prog' ? 'prog.dpr' : matches[4] + '.pas',
});
} else {
@@ -66,7 +66,7 @@ export class MapFileReaderDelphi extends MapFileReader {
this.isegments.push({
...this.addressToObject(matches[1], matches[2]),
id: this.isegments.length + 1,
segmentLength: parseInt(matches[3], 16),
segmentLength: Number.parseInt(matches[3], 16),
unitName: matches[4] === 'prog' ? 'prog.dpr' : matches[4] + '.pas',
});
}
@@ -107,7 +107,7 @@ export class MapFileReaderDelphi extends MapFileReader {
if (matches) {
this.lineNumbers.push({
...this.addressToObject(matches[2], matches[3]),
lineNumber: parseInt(matches[1], 10),
lineNumber: Number.parseInt(matches[1], 10),
});
hasLineNumbers = true;
+4 -4
View File
@@ -32,7 +32,7 @@ export class MapFileReaderVS extends MapFileReader {
override tryReadingPreferredAddress(line: string) {
const matches = line.match(this.regexVSLoadAddress);
if (matches) {
this.preferredLoadAddress = parseInt(matches[1], 16);
this.preferredLoadAddress = Number.parseInt(matches[1], 16);
}
}
@@ -50,7 +50,7 @@ export class MapFileReaderVS extends MapFileReader {
this.segments.push({
...this.addressToObject(matches[1], matches[2]),
id: this.segments.length + 1,
segmentLength: parseInt(matches[3], 16),
segmentLength: Number.parseInt(matches[3], 16),
unitName: false,
});
}
@@ -62,10 +62,10 @@ export class MapFileReaderVS extends MapFileReader {
override tryReadingNamedAddress(line: string) {
const matches = line.match(this.regexVsNames);
if (matches && matches.length >= 7 && matches[4] !== '') {
const addressWithOffset = parseInt(matches[4], 16);
const addressWithOffset = Number.parseInt(matches[4], 16);
const symbolObject = {
segment: matches[1],
addressWithoutOffset: parseInt(matches[2], 16),
addressWithoutOffset: Number.parseInt(matches[2], 16),
addressInt: addressWithOffset,
address: addressWithOffset.toString(16),
displayName: matches[3],
+2 -2
View File
@@ -126,7 +126,7 @@ export class MapFileReader {
}
}
return this.preferredLoadAddress + parseInt(segment, 16) * this.segmentMultiplier;
return this.preferredLoadAddress + Number.parseInt(segment, 16) * this.segmentMultiplier;
}
setSegmentOffset(segment: string, address: number) {
@@ -286,7 +286,7 @@ export class MapFileReader {
}
addressToObject(segment: string, address: string): LineNumber {
const addressWithoutOffset = parseInt(address, 16);
const addressWithoutOffset = Number.parseInt(address, 16);
const addressWithOffset = this.getSegmentOffset(segment) + addressWithoutOffset;
return {
+1 -1
View File
@@ -80,7 +80,7 @@ export class Graceful {
}
public static clear() {
Graceful.listeners.splice(0, Infinity);
Graceful.listeners.splice(0, Number.POSITIVE_INFINITY);
Graceful.updateRegistration();
}
+1 -1
View File
@@ -38,7 +38,7 @@ export class AsmParserBeebAsm extends AsmParser {
if (addressAndInstructionMatch) {
assert(addressAndInstructionMatch.groups);
const opcodes = (addressAndInstructionMatch.groups.opcodes || '').split(' ').filter(x => !!x);
const address = parseInt(addressAndInstructionMatch.groups.address, 16);
const address = Number.parseInt(addressAndInstructionMatch.groups.address, 16);
asmLines.push({
address: address,
opcodes: opcodes,
+1 -1
View File
@@ -115,7 +115,7 @@ export class CC65AsmParser extends AsmParser {
if (address) {
result.push({
text: label + ':',
address: parseInt(address[1], 16),
address: Number.parseInt(address[1], 16),
});
} else {
result.push({
+1 -1
View File
@@ -51,7 +51,7 @@ export class AsmParserCpp implements IAsmParser {
// TODO perhaps we'll need to check the file here at some point in the future.
// TODO I've temporarily disabled this as the result is visually too noisy
// was: source = {file: null, line: parseInt(match.groups.line)};
source = {file: match.groups.file, line: parseInt(match.groups.line)};
source = {file: match.groups.file, line: Number.parseInt(match.groups.line)};
if (filters.directives) {
continue;
}
+3 -3
View File
@@ -93,11 +93,11 @@ export class DartAsmParser extends AsmParser {
if (dontMaskFilenames) {
source = {
file: utils.maskRootdir(match[1]),
line: parseInt(match.groups.line),
line: Number.parseInt(match.groups.line),
mainsource: true,
};
} else {
source = {file: null, line: parseInt(match.groups.line), mainsource: true};
source = {file: null, line: Number.parseInt(match.groups.line), mainsource: true};
}
continue;
}
@@ -134,7 +134,7 @@ export class DartAsmParser extends AsmParser {
match = line.match(this.asmOpcodeRe);
if (match) {
assert(match.groups);
const address = parseInt(match.groups.address, 16);
const address = Number.parseInt(match.groups.address, 16);
const opcodes = (match.groups.opcodes || '').split(' ').filter(x => !!x);
const disassembly = ' ' + AsmRegex.filterAsmLine(match.groups.disasm, filters);
const destMatch = line.match(this.destRe);
+2 -2
View File
@@ -156,12 +156,12 @@ export class DotNetAsmParser implements IAsmParser {
for (const i in result.labelDef) {
const label = result.labelDef[i];
labelDefinitions.push([label.name, parseInt(i)]);
labelDefinitions.push([label.name, Number.parseInt(i)]);
}
for (const i in result.methodDef) {
const method = result.methodDef[i];
labelDefinitions.push([method, parseInt(i)]);
labelDefinitions.push([method, Number.parseInt(i)]);
}
for (const line in asmLines) {
+1 -1
View File
@@ -110,7 +110,7 @@ export class AsmEWAVRParser extends AsmParser {
const getLineNumberFromComment = (line: string) => {
const matches = line.match(this.lineNumberComment);
if (matches) {
return parseInt(matches[1]);
return Number.parseInt(matches[1]);
} else {
return null;
}
+3 -3
View File
@@ -82,7 +82,7 @@ export class MadsAsmParser extends AsmParser {
): ParsedAsmResultLine {
const labelsInLine: AsmResultLabel[] = [];
const address = parseInt(matchGroups.address, 16);
const address = Number.parseInt(matchGroups.address, 16);
const opcodes = (matchGroups.opcodes || '').split(' ').filter(x => !!x);
let text = '';
if (matchGroups.label) {
@@ -170,7 +170,7 @@ export class MadsAsmParser extends AsmParser {
match = line.match(this.standAloneLabel);
if (match) {
const address = parseInt(match[1], 16);
const address = Number.parseInt(match[1], 16);
const label = match[2];
labelDefinitions[label] = asm.length;
asm.push({
@@ -205,7 +205,7 @@ export class MadsAsmParser extends AsmParser {
match = line.match(this.varAssignment);
if (match) {
const address = parseInt(match[1], 16);
const address = Number.parseInt(match[1], 16);
const label = match[3];
labelDefinitions[label] = asm.length;
asm.push({
+5 -5
View File
@@ -35,7 +35,7 @@ export class SPIRVAsmParser extends AsmParser {
for (const line of asmLines) {
const match = line.match(opString);
if (match) {
const lineNum = parseInt(match[1]);
const lineNum = Number.parseInt(match[1]);
files[lineNum] = match[2];
}
}
@@ -128,7 +128,7 @@ export class SPIRVAsmParser extends AsmParser {
let inString = false;
let source: any = null;
let lastLine: string = '';
let lastLine = '';
for (let line of asmLines) {
if (inString) {
@@ -164,11 +164,11 @@ export class SPIRVAsmParser extends AsmParser {
match = line.match(sourceTag);
if (match) {
source = {
file: utils.maskRootdir(opStrings[parseInt(match[1])]),
line: parseInt(match[2]),
file: utils.maskRootdir(opStrings[Number.parseInt(match[1])]),
line: Number.parseInt(match[2]),
mainsource: true,
};
const sourceCol = parseInt(match[3]);
const sourceCol = Number.parseInt(match[3]);
if (!isNaN(sourceCol) && sourceCol !== 0) {
source.column = sourceCol;
}
+2 -2
View File
@@ -83,12 +83,12 @@ export class TurboCAsmParser extends AsmParser {
if (filters.dontMaskFilenames) {
source = {
file: currentfile,
line: parseInt(currentline),
line: Number.parseInt(currentline),
};
} else {
source = {
file: null,
line: parseInt(currentline),
line: Number.parseInt(currentline),
};
}
}
+1 -1
View File
@@ -120,7 +120,7 @@ export class VcAsmParser extends AsmParser {
const getLineNumberFromComment = (line: string) => {
const matches = line.match(this.lineNumberComment);
if (matches) {
return parseInt(matches[1]);
return Number.parseInt(matches[1]);
} else {
return null;
}
+3 -3
View File
@@ -61,7 +61,7 @@ export class AsmParserZ88dk extends AsmParser {
const handleSource = (line: string) => {
const match = line.match(this.sourceTag);
if (match) {
const sourceLine = parseInt(match[1]);
const sourceLine = Number.parseInt(match[1]);
const file = utils.maskRootdir(match[2]);
if (file) {
if (dontMaskFilenames) {
@@ -76,7 +76,7 @@ export class AsmParserZ88dk extends AsmParser {
line: sourceLine,
};
}
const sourceCol = parseInt(match[3]);
const sourceCol = Number.parseInt(match[3]);
if (!isNaN(sourceCol) && sourceCol !== 0) {
source.column = sourceCol;
}
@@ -230,7 +230,7 @@ export class AsmParserZ88dk extends AsmParser {
const match = line.match(this.asmOpcodeRe);
if (match) {
assert(match.groups);
const address = parseInt(match.groups.address, 16);
const address = Number.parseInt(match.groups.address, 16);
const opcodes = (match.groups.opcodes || '').split(' ').filter(x => !!x);
const disassembly = ' ' + AsmRegex.filterAsmLine(match.groups.disasm.trim(), filters);
const destMatch = line.match(this.destRe);
+2 -2
View File
@@ -55,7 +55,7 @@ export class AsmRaw extends AsmRegex {
match = line.match(asmOpcodeRe);
if (match) {
const address = parseInt(match[1], 16);
const address = Number.parseInt(match[1], 16);
const opcodes = match[2].split(' ').filter(Boolean);
const disassembly = ' ' + AsmRegex.filterAsmLine(match[4], filters);
let links: AsmResultLink[] | undefined;
@@ -65,7 +65,7 @@ export class AsmRaw extends AsmRegex {
{
offset: disassembly.indexOf(destMatch[1]),
length: destMatch[1].length,
to: parseInt(destMatch[1], 16),
to: Number.parseInt(destMatch[1], 16),
},
];
}
+1 -1
View File
@@ -205,7 +205,7 @@ export class LlvmPassDumpParser {
name: string;
lines: ResultLine[];
} | null = null;
let isMachineFunctionOpen: boolean = false;
let isMachineFunctionOpen = false;
for (const line of dump.lines) {
const irFnMatch = line.text.match(this.functionDefine);
const machineFnMatch = line.text.match(this.machineFunctionBegin);
+1 -1
View File
@@ -116,7 +116,7 @@ export class RacketPassDumpParser {
}
const linkletPhaseMatch = line.text.match(this.linkletPhaseHeader);
if (linkletPhaseMatch) {
linkletPhase = parseInt(linkletPhaseMatch[1]);
linkletPhase = Number.parseInt(linkletPhaseMatch[1]);
continue;
}
const stepMatch = line.text.match(this.stepHeader);
+3 -3
View File
@@ -165,7 +165,7 @@ export class PELabelReconstructor {
const matches = line.match(this.addressRegex);
if (matches) {
const lineAddr = parseInt(matches[1], 16);
const lineAddr = Number.parseInt(matches[1], 16);
if (startIdx === -1 && lineAddr >= beginAddress) {
startIdx = lineIdx;
if (line.endsWith('<CODE>:') || line.endsWith('<.text>:') || line.endsWith('<.itext>:')) {
@@ -197,7 +197,7 @@ export class PELabelReconstructor {
const address = matches[3];
if (!address.includes('+') && !address.includes('-')) {
let labelName = 'L' + address;
const namedAddr = this.mapFileReader.getSymbolAt(undefined, parseInt(address, 16));
const namedAddr = this.mapFileReader.getSymbolAt(undefined, Number.parseInt(address, 16));
if (namedAddr && namedAddr.displayName) {
labelName = namedAddr.displayName;
}
@@ -236,7 +236,7 @@ export class PELabelReconstructor {
const matches = line.match(this.addressRegex);
if (matches) {
const addressStr = matches[1];
const address = parseInt(addressStr, 16);
const address = Number.parseInt(addressStr, 16);
const segmentInfo = this.mapFileReader.getSegmentInfoByStartingAddress(undefined, address);
if (segmentInfo) {
+1 -3
View File
@@ -120,9 +120,7 @@ export function reset() {
}
export function propsFor(base: string): PropertyGetter {
return function (property: string, defaultValue: any) {
return get(base, property, defaultValue);
};
return (property: string, defaultValue: any) => get(base, property, defaultValue);
}
// function mappedOf(fn, funcA, funcB) {
+2 -2
View File
@@ -23,14 +23,14 @@
// POSSIBILITY OF SUCH DAMAGE.
import fs from 'fs';
import fsp from 'fs/promises';
import path from 'path';
import fsp from 'fs/promises';
import type {Source, SourceApiEntry, SourceEntry} from '../../types/source.interfaces.js';
import * as props from '../properties.js';
const EXAMPLES_PATH = props.get('builtin', 'sourcePath', './examples/') as string;
const NAME_SUBSTUTION_PATTERN = new RegExp('_', 'g');
const NAME_SUBSTUTION_PATTERN = /_/g;
const ALL_EXAMPLES: SourceEntry[] = fs.readdirSync(EXAMPLES_PATH).flatMap(folder => {
// Recurse through the language folders
const folderPath = path.join(EXAMPLES_PATH, folder);
+1 -1
View File
@@ -80,7 +80,7 @@ function sponsorIconSetsOk(
): boolean {
const countsByShowEvery: Map<number, number[]> = new Map();
for (const [icon, count] of sponsorAppearanceCount.entries()) {
const seenEvery = count > 0 ? totalAppearances / count : Infinity;
const seenEvery = count > 0 ? totalAppearances / count : Number.POSITIVE_INFINITY;
if (seenEvery > icon.topIconShowEvery) {
return false;
}
+1 -1
View File
@@ -47,7 +47,7 @@ export function parse(suText: string): StackUsageInfo[] {
DebugLoc: {File: pathLocName[0], Line: lineNumber, Column: 0},
Function: pathLocName.at(-1),
Qualifier: qualifier,
BytesUsed: parseInt(c[1]),
BytesUsed: Number.parseInt(c[1]),
displayString: c[1] + ' bytes, ' + qualifier,
};
output.push(su as StackUsageInfo);
+1 -1
View File
@@ -63,7 +63,7 @@ export class SymbolStore {
softExclude(otherStore: SymbolStore) {
for (const symbol in otherStore.uniqueSymbols) {
let shouldExclude = false;
let checksymbol: string = '';
let checksymbol = '';
for (checksymbol in this.uniqueSymbols) {
if (checksymbol.endsWith(symbol)) {
shouldExclude = true;
+1 -3
View File
@@ -38,9 +38,7 @@ export class OSACATool extends BaseTool {
async writeAsmFile(asmParser: IAsmParser, asm: string, filters: ParseFiltersAndOutputOptions, destination: string) {
// Applying same filters as applied to compiler outpu
const filteredAsm = asmParser.process(asm, filters).asm.reduce(function (acc, line) {
return acc + line.text + '\n';
}, '');
const filteredAsm = asmParser.process(asm, filters).asm.reduce((acc, line) => acc + line.text + '\n', '');
return fs.writeFile(destination, filteredAsm);
}
+1 -3
View File
@@ -72,9 +72,7 @@ export class PvsStudioTool extends BaseTool {
const manualCompileFlags = compilationInfo.options.filter((option: string) => option !== inputFilepath);
compileFlags = compileFlags.concat(manualCompileFlags);
compileFlags = compileFlags.filter(function (flag) {
return flag !== '';
});
compileFlags = compileFlags.filter(flag => flag !== '');
// Deal with args
args = [];
+15 -15
View File
@@ -132,11 +132,11 @@ const SOURCE_WITH_FILENAME = /^\s*([\w.]+)[(:](\d+)(:?,?(\d+):?)?[):]*\s*(.*)/;
const ATFILELINE_RE = /\s*at ([\w-/.]+):(\d+)/;
export enum LineParseOption {
SourceMasking,
RootMasking,
SourceWithLineMessage,
FileWithLineMessage,
AtFileLine,
SourceMasking = 0,
RootMasking = 1,
SourceWithLineMessage = 2,
FileWithLineMessage = 3,
AtFileLine = 4,
}
export type LineParseOptions = LineParseOption[];
@@ -153,8 +153,8 @@ function applyParse_SourceWithLine(lineObj: ResultLine, filteredLine: string, in
if (match) {
const message = match[4].trim();
lineObj.tag = {
line: parseInt(match[1]),
column: parseInt(match[3] || '0'),
line: Number.parseInt(match[1]),
column: Number.parseInt(match[3] || '0'),
text: message,
severity: parseSeverity(message),
file: inputFilename ? path.basename(inputFilename) : undefined,
@@ -168,8 +168,8 @@ function applyParse_FileWithLine(lineObj: ResultLine, filteredLine: string) {
const message = match[5].trim();
lineObj.tag = {
file: match[1],
line: parseInt(match[2]),
column: parseInt(match[4] || '0'),
line: Number.parseInt(match[2]),
column: Number.parseInt(match[4] || '0'),
text: message,
severity: parseSeverity(message),
};
@@ -182,7 +182,7 @@ function applyParse_AtFileLine(lineObj: ResultLine, filteredLine: string) {
if (match[1].startsWith('/app/')) {
lineObj.tag = {
file: match[1].replace(/^\/app\//, ''),
line: parseInt(match[2]),
line: Number.parseInt(match[2]),
column: 0,
text: filteredLine,
severity: 3,
@@ -190,7 +190,7 @@ function applyParse_AtFileLine(lineObj: ResultLine, filteredLine: string) {
} else if (!match[1].startsWith('/')) {
lineObj.tag = {
file: match[1],
line: parseInt(match[2]),
line: Number.parseInt(match[2]),
column: 0,
text: filteredLine,
severity: 3,
@@ -242,8 +242,8 @@ export function parseRustOutput(lines: string, inputFilename?: string, pathPrefi
const match = filterEscapeSequences(line).match(re);
if (match) {
const line = parseInt(match[1]);
const column = parseInt(match[3] || '0');
const line = Number.parseInt(match[1]);
const column = Number.parseInt(match[3] || '0');
const previous = result.pop();
if (previous !== undefined) {
@@ -388,8 +388,8 @@ export function squashHorizontalWhitespace(line: string, atStart = true): string
export function toProperty(prop: string): boolean | number | string {
if (prop === 'true' || prop === 'yes') return true;
if (prop === 'false' || prop === 'no') return false;
if (/^-?(0|[1-9]\d*)$/.test(prop)) return parseInt(prop);
if (/^-?\d*\.\d+$/.test(prop)) return parseFloat(prop);
if (/^-?(0|[1-9]\d*)$/.test(prop)) return Number.parseInt(prop);
if (/^-?\d*\.\d+$/.test(prop)) return Number.parseFloat(prop);
return prop;
}
+1 -1
View File
@@ -87,7 +87,7 @@
"yaml": "^2.6.0"
},
"devDependencies": {
"@biomejs/biome": "^1.9.4",
"@biomejs/biome": "^1.9.4",
"@sentry/types": "^8.36.0",
"@smithy/util-stream": "^3.2.1",
"@types/bootstrap": "^5.2.10",
+6 -6
View File
@@ -35,8 +35,8 @@ type StackFrame = {
};
enum TraceFormat {
V8,
Firefox,
V8 = 0,
Firefox = 1,
}
export function parse(err: Error) {
@@ -112,11 +112,11 @@ export function parse(err: Error) {
return {
fileName: lineMatch[2] || undefined,
lineNumber: parseInt(lineMatch[3], 10) || undefined,
lineNumber: Number.parseInt(lineMatch[3], 10) || undefined,
functionName: functionName,
typeName: typeName,
methodName: methodName,
columnNumber: parseInt(lineMatch[4], 10) || undefined,
columnNumber: Number.parseInt(lineMatch[4], 10) || undefined,
native: isNative,
};
})
@@ -163,11 +163,11 @@ export function parse(err: Error) {
return {
fileName: lineMatch[2] || undefined,
lineNumber: parseInt(lineMatch[3], 10) || undefined,
lineNumber: Number.parseInt(lineMatch[3], 10) || undefined,
functionName: functionName,
typeName: typeName,
methodName: methodName,
columnNumber: parseInt(lineMatch[4], 10) || undefined,
columnNumber: Number.parseInt(lineMatch[4], 10) || undefined,
};
})
.filter(frame => frame !== undefined) as StackFrame[];
+1 -1
View File
@@ -25,8 +25,8 @@
import _ from 'underscore';
import {
AssemblyDocumentationResponse,
AssemblyDocumentationRequest,
AssemblyDocumentationResponse,
} from '../../types/features/assembly-documentation.interfaces.js';
import {FormattingRequest, FormattingResponse} from './formatting.interfaces.js';
+3 -3
View File
@@ -22,8 +22,8 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
import _ from 'underscore';
import * as monaco from 'monaco-editor';
import _ from 'underscore';
interface RegisteredCodeLens {
compilerId: number;
@@ -62,12 +62,12 @@ function provide(model: monaco.editor.ITextModel): monaco.languages.CodeLensList
if (item) {
return {
lenses: item.lenses,
dispose: function () {},
dispose: () => {},
};
} else {
return {
lenses: [],
dispose: function () {},
dispose: () => {},
};
}
}
+1 -1
View File
@@ -93,7 +93,7 @@ export function applyColours(
): void {
const scheme = schemes.find(scheme => scheme.name === schemeName) ?? schemes[0];
const newDecorations: monaco.editor.IModelDeltaDecoration[] = Object.entries(colours).map(([line, index]) => {
const realLineNumber = parseInt(line) + 1;
const realLineNumber = Number.parseInt(line) + 1;
return {
range: new monaco.Range(realLineNumber, 1, realLineNumber, 1),
options: {
+4 -4
View File
@@ -22,10 +22,10 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
import $ from 'jquery';
import _ from 'underscore';
import {LRUCache} from 'lru-cache';
import {EventEmitter} from 'golden-layout';
import $ from 'jquery';
import {LRUCache} from 'lru-cache';
import _ from 'underscore';
import {options} from './options.js';
@@ -33,8 +33,8 @@ import {ResultLine} from '../types/resultline/resultline.interfaces.js';
import jqXHR = JQuery.jqXHR;
import ErrorTextStatus = JQuery.Ajax.ErrorTextStatus;
import {CompilerInfo} from '../types/compiler.interfaces.js';
import {CompilationResult, FiledataPair} from '../types/compilation/compilation.interfaces.js';
import {CompilerInfo} from '../types/compiler.interfaces.js';
import {CompilationStatus} from './compiler-service.interfaces.js';
import {IncludeDownloads, SourceAndFiles} from './download-service.js';
import {SentryCapture} from './sentry.js';
+5 -5
View File
@@ -22,13 +22,13 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
import type {ICompilerShared} from './compiler-shared.interfaces.js';
import {CompilerOverridesWidget} from './widgets/compiler-overrides.js';
import type {CompilerState} from './panes/compiler.interfaces.js';
import type {ConfiguredOverrides} from './compilation/compiler-overrides.interfaces.js';
import type {ExecutorState} from './panes/executor.interfaces.js';
import {RuntimeToolsWidget} from './widgets/runtime-tools.js';
import type {ICompilerShared} from './compiler-shared.interfaces.js';
import {ConfiguredRuntimeTools} from './execution/execution.interfaces.js';
import type {CompilerState} from './panes/compiler.interfaces.js';
import type {ExecutorState} from './panes/executor.interfaces.js';
import {CompilerOverridesWidget} from './widgets/compiler-overrides.js';
import {RuntimeToolsWidget} from './widgets/runtime-tools.js';
export class CompilerShared implements ICompilerShared {
private domRoot: JQuery<HTMLElement>;
+4 -4
View File
@@ -23,13 +23,13 @@
// POSSIBILITY OF SUCH DAMAGE.
import {CompilerOutputOptions} from '../types/features/filters.interfaces.js';
import {CfgState} from './panes/cfg-view.interfaces.js';
import {ClangirState} from './panes/clangir-view.interfaces.js';
import {OptPipelineViewState} from './panes/opt-pipeline.interfaces.js';
import {GccDumpViewState} from './panes/gccdump-view.interfaces.js';
import {ConfiguredOverrides} from './compilation/compiler-overrides.interfaces.js';
import {ConfiguredRuntimeTools} from './execution/execution.interfaces.js';
import {CfgState} from './panes/cfg-view.interfaces.js';
import {ClangirState} from './panes/clangir-view.interfaces.js';
import {GccDumpViewState} from './panes/gccdump-view.interfaces.js';
import {IrState} from './panes/ir-view.interfaces.js';
import {OptPipelineViewState} from './panes/opt-pipeline.interfaces.js';
import {MonacoPaneState} from './panes/pane.interfaces.js';
export const COMPILER_COMPONENT_NAME = 'compiler';
export const EXECUTOR_COMPONENT_NAME = 'executor';
+76 -76
View File
@@ -25,92 +25,92 @@
import {ParseFiltersAndOutputOptions} from '../types/features/filters.interfaces.js';
import {GccDumpViewState} from './panes/gccdump-view.interfaces.js';
import {ConfiguredOverrides} from './compilation/compiler-overrides.interfaces.js';
import {
EmptyCompilerState,
ComponentConfig,
PopulatedCompilerState,
CompilerForTreeState,
EmptyExecutorState,
PopulatedExecutorState,
ExecutorForTreeState,
EmptyEditorState,
PopulatedEditorState,
EmptyTreeState,
OutputState,
ToolViewState,
EmptyToolInputViewState,
PopulatedToolInputViewState,
PopulatedOptViewState,
EmptyOptViewState,
EmptyFlagsViewState,
PopulatedFlagsViewState,
EmptyDiffViewState,
PopulatedDiffViewState,
EmptyPpViewState,
PopulatedPpViewState,
EmptyAstViewState,
PopulatedAstViewState,
EmptyGccDumpViewState,
PopulatedGccDumpViewState,
EmptyCfgViewState,
PopulatedCfgViewState,
PopulatedConformanceViewState,
EmptyIrViewState,
PopulatedIrViewState,
EmptyClangirViewState,
PopulatedClangirViewState,
EmptyRustMirViewState,
PopulatedRustMirViewState,
EmptyHaskellCoreViewState,
PopulatedHaskellCoreViewState,
EmptyHaskellStgViewState,
PopulatedHaskellStgViewState,
EmptyHaskellCmmViewState,
PopulatedHaskellCmmViewState,
EmptyGnatDebugTreeViewState,
PopulatedGnatDebugTreeViewState,
EmptyGnatDebugViewState,
PopulatedGnatDebugViewState,
EmptyRustMacroExpViewState,
PopulatedRustMacroExpViewState,
EmptyRustHirViewState,
PopulatedRustHirViewState,
EmptyDeviceViewState,
PopulatedDeviceViewState,
COMPILER_COMPONENT_NAME,
EXECUTOR_COMPONENT_NAME,
EDITOR_COMPONENT_NAME,
TREE_COMPONENT_NAME,
OUTPUT_COMPONENT_NAME,
TOOL_COMPONENT_NAME,
TOOL_INPUT_VIEW_COMPONENT_NAME,
DIFF_VIEW_COMPONENT_NAME,
OPT_VIEW_COMPONENT_NAME,
STACK_USAGE_VIEW_COMPONENT_NAME,
FLAGS_VIEW_COMPONENT_NAME,
PP_VIEW_COMPONENT_NAME,
AST_VIEW_COMPONENT_NAME,
GCC_DUMP_VIEW_COMPONENT_NAME,
CFG_VIEW_COMPONENT_NAME,
CONFORMANCE_VIEW_COMPONENT_NAME,
IR_VIEW_COMPONENT_NAME,
CLANGIR_VIEW_COMPONENT_NAME,
RUST_MIR_VIEW_COMPONENT_NAME,
HASKELL_CORE_VIEW_COMPONENT_NAME,
HASKELL_STG_VIEW_COMPONENT_NAME,
HASKELL_CMM_VIEW_COMPONENT_NAME,
COMPILER_COMPONENT_NAME,
CONFORMANCE_VIEW_COMPONENT_NAME,
CompilerForTreeState,
ComponentConfig,
DEVICE_VIEW_COMPONENT_NAME,
DIFF_VIEW_COMPONENT_NAME,
EDITOR_COMPONENT_NAME,
EXECUTOR_COMPONENT_NAME,
EmptyAstViewState,
EmptyCfgViewState,
EmptyClangirViewState,
EmptyCompilerState,
EmptyDeviceViewState,
EmptyDiffViewState,
EmptyEditorState,
EmptyExecutorState,
EmptyFlagsViewState,
EmptyGccDumpViewState,
EmptyGnatDebugTreeViewState,
EmptyGnatDebugViewState,
EmptyHaskellCmmViewState,
EmptyHaskellCoreViewState,
EmptyHaskellStgViewState,
EmptyIrViewState,
EmptyOptPipelineViewState,
EmptyOptViewState,
EmptyPpViewState,
EmptyRustHirViewState,
EmptyRustMacroExpViewState,
EmptyRustMirViewState,
EmptyStackUsageViewState,
EmptyToolInputViewState,
EmptyTreeState,
ExecutorForTreeState,
FLAGS_VIEW_COMPONENT_NAME,
GCC_DUMP_VIEW_COMPONENT_NAME,
GNAT_DEBUG_TREE_VIEW_COMPONENT_NAME,
GNAT_DEBUG_VIEW_COMPONENT_NAME,
RUST_MACRO_EXP_VIEW_COMPONENT_NAME,
RUST_HIR_VIEW_COMPONENT_NAME,
DEVICE_VIEW_COMPONENT_NAME,
HASKELL_CMM_VIEW_COMPONENT_NAME,
HASKELL_CORE_VIEW_COMPONENT_NAME,
HASKELL_STG_VIEW_COMPONENT_NAME,
IR_VIEW_COMPONENT_NAME,
OPT_PIPELINE_VIEW_COMPONENT_NAME,
EmptyOptPipelineViewState,
OPT_VIEW_COMPONENT_NAME,
OUTPUT_COMPONENT_NAME,
OutputState,
PP_VIEW_COMPONENT_NAME,
PopulatedAstViewState,
PopulatedCfgViewState,
PopulatedClangirViewState,
PopulatedCompilerState,
PopulatedConformanceViewState,
PopulatedDeviceViewState,
PopulatedDiffViewState,
PopulatedEditorState,
PopulatedExecutorState,
PopulatedFlagsViewState,
PopulatedGccDumpViewState,
PopulatedGnatDebugTreeViewState,
PopulatedGnatDebugViewState,
PopulatedHaskellCmmViewState,
PopulatedHaskellCoreViewState,
PopulatedHaskellStgViewState,
PopulatedIrViewState,
PopulatedOptPipelineViewState,
PopulatedOptViewState,
PopulatedPpViewState,
PopulatedRustHirViewState,
PopulatedRustMacroExpViewState,
PopulatedRustMirViewState,
PopulatedStackUsageViewState,
EmptyStackUsageViewState,
PopulatedToolInputViewState,
RUST_HIR_VIEW_COMPONENT_NAME,
RUST_MACRO_EXP_VIEW_COMPONENT_NAME,
RUST_MIR_VIEW_COMPONENT_NAME,
STACK_USAGE_VIEW_COMPONENT_NAME,
TOOL_COMPONENT_NAME,
TOOL_INPUT_VIEW_COMPONENT_NAME,
TREE_COMPONENT_NAME,
ToolViewState,
} from './components.interfaces.js';
import {ConfiguredOverrides} from './compilation/compiler-overrides.interfaces.js';
import {ConfiguredRuntimeTools} from './execution/execution.interfaces.js';
import {LanguageKey} from './languages.interfaces.js';
+9 -9
View File
@@ -22,19 +22,19 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
import {CompilationResult} from '../types/compilation/compilation.interfaces.js';
import {CompilerInfo} from '../types/compiler.interfaces.js';
import {Language, LanguageKey} from '../types/languages.interfaces.js';
import {MessageWithLocation} from '../types/resultline/resultline.interfaces.js';
import {ClangirBackendOptions} from './compilation/clangir.interfaces.js';
import {LLVMIrBackendOptions} from './compilation/ir.interfaces.js';
import {OptPipelineBackendOptions} from './compilation/opt-pipeline-output.interfaces.js';
import {NewToolSettings, ToolState} from './components.interfaces.js';
import {Motd} from './motd.interfaces.js';
import {GccDumpFiltersState, GccDumpViewSelectedPass} from './panes/gccdump-view.interfaces.js';
import {PPOptions} from './panes/pp-view.interfaces.js';
import {SiteSettings} from './settings.js';
import {Theme} from './themes.js';
import {PPOptions} from './panes/pp-view.interfaces.js';
import {GccDumpFiltersState, GccDumpViewSelectedPass} from './panes/gccdump-view.interfaces.js';
import {Motd} from './motd.interfaces.js';
import {CompilerInfo} from '../types/compiler.interfaces.js';
import {CompilationResult} from '../types/compilation/compilation.interfaces.js';
import {OptPipelineBackendOptions} from './compilation/opt-pipeline-output.interfaces.js';
import {LLVMIrBackendOptions} from './compilation/ir.interfaces.js';
import {ClangirBackendOptions} from './compilation/clangir.interfaces.js';
import {NewToolSettings, ToolState} from './components.interfaces.js';
// This list comes from executing
// grep -rPo "eventHub\.(on|emit)\('.*'," static/ | cut -d "'" -f2 | sort | uniq
+3 -3
View File
@@ -24,11 +24,11 @@
import * as monaco from 'monaco-editor';
import {Alert} from './widgets/alert.js';
import {Settings} from './settings.js';
import {FormattingRequest} from './api/formatting.interfaces.js';
import {getFormattedCode} from './api/api.js';
import {FormattingRequest} from './api/formatting.interfaces.js';
import {unwrap} from './assert.js';
import {Settings} from './settings.js';
import {Alert} from './widgets/alert.js';
// Proxy function to emit the error to the alert system
const onFormatError = (cause: string, source: string) => {
+1 -5
View File
@@ -22,8 +22,8 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
import {IFrontendTesting} from './tests/frontend-testing.interfaces.js';
import {Options} from './options.interfaces.js';
import {IFrontendTesting} from './tests/frontend-testing.interfaces.js';
export type CompilerExplorerOptions = Record<string, unknown> & Options;
@@ -38,7 +38,3 @@ declare global {
onSponsorClick: (sponsorUrl: string) => void;
}
}
// Necessary because we're not exporting any actual symbols from this file
// See https://www.typescriptlang.org/docs/handbook/declaration-files/templates/global-modifying-module-d-ts.html
export {};
+6 -6
View File
@@ -45,8 +45,8 @@ function assert(condition: boolean, message?: string, ...args: any[]): asserts c
}
enum SegmentType {
Horizontal,
Vertical,
Horizontal = 0,
Vertical = 1,
}
type Coordinate = {
@@ -95,9 +95,9 @@ type Block = {
};
enum DfsState {
NotVisited,
Pending,
Visited,
NotVisited = 0,
Pending = 1,
Visited = 2,
}
type ColumnDescriptor = {
@@ -617,7 +617,7 @@ export class GraphLayoutCore {
VERTICAL = 0,
RIGHTCORNER = 1,
RIGHTU = 2,
NULL = NaN,
NULL = Number.NaN,
}
const segments: {
segment: EdgeSegment;
+1 -1
View File
@@ -23,8 +23,8 @@
// POSSIBILITY OF SUCH DAMAGE.
import _ from 'underscore';
import {Sharing} from './sharing.js';
import {localStorage} from './local.js';
import {Sharing} from './sharing.js';
const maxHistoryEntries = 30;
type Source = {dt: number; source: string};
+28 -28
View File
@@ -25,10 +25,12 @@
import GoldenLayout, {ContentItem} from 'golden-layout';
type GLC = GoldenLayout.Container;
import _ from 'underscore';
import {CompilerService} from './compiler-service.js';
import {
AST_VIEW_COMPONENT_NAME,
CFG_VIEW_COMPONENT_NAME,
CLANGIR_VIEW_COMPONENT_NAME,
COMPILER_COMPONENT_NAME,
CONFORMANCE_VIEW_COMPONENT_NAME,
DEVICE_VIEW_COMPONENT_NAME,
@@ -43,53 +45,51 @@ import {
HASKELL_CORE_VIEW_COMPONENT_NAME,
HASKELL_STG_VIEW_COMPONENT_NAME,
IR_VIEW_COMPONENT_NAME,
CLANGIR_VIEW_COMPONENT_NAME,
OPT_PIPELINE_VIEW_COMPONENT_NAME,
LLVM_OPT_PIPELINE_VIEW_COMPONENT_NAME,
OPT_PIPELINE_VIEW_COMPONENT_NAME,
OPT_VIEW_COMPONENT_NAME,
STACK_USAGE_VIEW_COMPONENT_NAME,
OUTPUT_COMPONENT_NAME,
PP_VIEW_COMPONENT_NAME,
RUST_HIR_VIEW_COMPONENT_NAME,
RUST_MACRO_EXP_VIEW_COMPONENT_NAME,
RUST_MIR_VIEW_COMPONENT_NAME,
STACK_USAGE_VIEW_COMPONENT_NAME,
TOOL_COMPONENT_NAME,
TOOL_INPUT_VIEW_COMPONENT_NAME,
TREE_COMPONENT_NAME,
} from './components.interfaces.js';
import {EventHub} from './event-hub.js';
import {Editor} from './panes/editor.js';
import {Tree} from './panes/tree.js';
import {Compiler} from './panes/compiler.js';
import {Executor} from './panes/executor.js';
import {Output} from './panes/output.js';
import {Tool} from './panes/tool.js';
import {Diff} from './panes/diff.js';
import {ToolInputView} from './panes/tool-input-view.js';
import {Opt as OptView} from './panes/opt-view.js';
import {StackUsage as StackUsageView} from './panes/stack-usage-view.js';
import {Flags as FlagsView} from './panes/flags-view.js';
import {PP as PreProcessorView} from './panes/pp-view.js';
import {EventMap} from './event-map.js';
import {IdentifierSet} from './identifier-set.js';
import {LanguageKey} from './languages.interfaces.js';
import {Ast as AstView} from './panes/ast-view.js';
import {Ir as IrView} from './panes/ir-view.js';
import {Cfg as CfgView} from './panes/cfg-view.js';
import {Clangir as ClangirView} from './panes/clangir-view.js';
import {OptPipeline} from './panes/opt-pipeline.js';
import {Compiler} from './panes/compiler.js';
import {Conformance as ConformanceView} from './panes/conformance-view.js';
import {DeviceAsm as DeviceView} from './panes/device-view.js';
import {Diff} from './panes/diff.js';
import {Editor} from './panes/editor.js';
import {Executor} from './panes/executor.js';
import {Flags as FlagsView} from './panes/flags-view.js';
import {GccDump as GCCDumpView} from './panes/gccdump-view.js';
import {GnatDebug as GnatDebugView} from './panes/gnatdebug-view.js';
import {RustMir as RustMirView} from './panes/rustmir-view.js';
import {RustHir as RustHirView} from './panes/rusthir-view.js';
import {GnatDebugTree as GnatDebugTreeView} from './panes/gnatdebugtree-view.js';
import {HaskellCmm as HaskellCmmView} from './panes/haskellcmm-view.js';
import {HaskellCore as HaskellCoreView} from './panes/haskellcore-view.js';
import {HaskellStg as HaskellStgView} from './panes/haskellstg-view.js';
import {HaskellCmm as HaskellCmmView} from './panes/haskellcmm-view.js';
import {GccDump as GCCDumpView} from './panes/gccdump-view.js';
import {Cfg as CfgView} from './panes/cfg-view.js';
import {Conformance as ConformanceView} from './panes/conformance-view.js';
import {GnatDebugTree as GnatDebugTreeView} from './panes/gnatdebugtree-view.js';
import {Ir as IrView} from './panes/ir-view.js';
import {OptPipeline} from './panes/opt-pipeline.js';
import {Opt as OptView} from './panes/opt-view.js';
import {Output} from './panes/output.js';
import {PP as PreProcessorView} from './panes/pp-view.js';
import {RustHir as RustHirView} from './panes/rusthir-view.js';
import {RustMacroExp as RustMacroExpView} from './panes/rustmacroexp-view.js';
import {IdentifierSet} from './identifier-set.js';
import {EventMap} from './event-map.js';
import {LanguageKey} from './languages.interfaces.js';
import _ from 'underscore';
import {RustMir as RustMirView} from './panes/rustmir-view.js';
import {StackUsage as StackUsageView} from './panes/stack-usage-view.js';
import {ToolInputView} from './panes/tool-input-view.js';
import {Tool} from './panes/tool.js';
import {Tree} from './panes/tree.js';
type EventDescriptorMap = {
[E in keyof EventMap]: [E, ...Parameters<EventMap[E]>];
+2 -2
View File
@@ -22,9 +22,9 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
import {options} from './options.js';
import {LanguageLibs, Library} from './options.interfaces.js';
import {Remote} from './compiler.interfaces.js';
import {LanguageLibs, Library} from './options.interfaces.js';
import {options} from './options.js';
const LIB_MATCH_RE = /([\w-]*)\.([\w-]*)/i;
+2 -2
View File
@@ -103,7 +103,7 @@ export class LineColouring {
let colourIdx = 0;
for (const editorIdStr of _.keys(this.colouredSourceLinesByEditor)) {
const editorId = parseInt(editorIdStr);
const editorId = Number.parseInt(editorIdStr);
const lines = this.getUniqueLinesForEditor(editorId);
for (const line of lines) {
@@ -116,7 +116,7 @@ export class LineColouring {
const editorIds = _.keys(this.linesAndColourByEditor);
for (const compilerIdStr of compilerIds) {
const compilerId = parseInt(compilerIdStr);
const compilerId = Number.parseInt(compilerIdStr);
for (const editorId of _.keys(this.colouredSourceLinesByEditor)) {
for (const info of this.colouredSourceLinesByEditor[editorId]) {
if (info.compilerId === compilerId && info.colourIdx >= 0) {
-2
View File
@@ -225,5 +225,3 @@ export function definition(): monaco.languages.IMonarchLanguage {
}
monaco.languages.register({id: 'ada'});
monaco.languages.setMonarchTokensProvider('ada', definition());
export {};
-2
View File
@@ -331,5 +331,3 @@ function definition(): monaco.languages.IMonarchLanguage {
monaco.languages.register({id: 'c3'});
monaco.languages.setMonarchTokensProvider('c3', definition());
export {};
-2
View File
@@ -98,5 +98,3 @@ function definition(): monaco.languages.IMonarchLanguage {
monaco.languages.register({id: 'clean'});
monaco.languages.setMonarchTokensProvider('clean', definition());
export {};
-2
View File
@@ -101,5 +101,3 @@ function configuration(): monaco.languages.LanguageConfiguration {
monaco.languages.register({id: 'cmake'});
monaco.languages.setMonarchTokensProvider('cmake', definition());
monaco.languages.setLanguageConfiguration('cmake', configuration());
export {};
-2
View File
@@ -1172,5 +1172,3 @@ function definition(): monaco.languages.IMonarchLanguage {
monaco.languages.register({id: 'cobol'});
monaco.languages.setMonarchTokensProvider('cobol', definition());
export {};
-2
View File
@@ -113,5 +113,3 @@ function definition(): monaco.languages.IMonarchLanguage {
monaco.languages.register({id: 'cpp-for-opencl'});
monaco.languages.setLanguageConfiguration('cpp-for-opencl', cpp.conf);
monaco.languages.setMonarchTokensProvider('cpp-for-opencl', definition());
export {};
-2
View File
@@ -138,5 +138,3 @@ function definition(): monaco.languages.IMonarchLanguage {
monaco.languages.register({id: 'cppcircle'});
monaco.languages.setLanguageConfiguration('cppcircle', cpp.conf);
monaco.languages.setMonarchTokensProvider('cppcircle', definition());
export {};
-2
View File
@@ -871,5 +871,3 @@ function definition(): monaco.languages.IMonarchLanguage {
monaco.languages.register({id: 'cpp2-cppfront'});
monaco.languages.setLanguageConfiguration('cpp2-cppfront', cpp.conf);
monaco.languages.setMonarchTokensProvider('cpp2-cppfront', definition());
export {};
-2
View File
@@ -46,5 +46,3 @@ function definition(): monaco.languages.IMonarchLanguage {
monaco.languages.register({id: 'cppx-blue'});
monaco.languages.setLanguageConfiguration('cppx-blue', cpp.conf);
monaco.languages.setMonarchTokensProvider('cppx-blue', definition());
export {};
-2
View File
@@ -305,5 +305,3 @@ function configuration(): monaco.languages.LanguageConfiguration {
monaco.languages.register({id: 'cppx-gold'});
monaco.languages.setMonarchTokensProvider('cppx-gold', definition());
monaco.languages.setLanguageConfiguration('cppx-gold', configuration());
export {};
-2
View File
@@ -62,5 +62,3 @@ function definition(): monaco.languages.IMonarchLanguage {
monaco.languages.register({id: 'cuda'});
monaco.languages.setLanguageConfiguration('cuda', cpp.conf);
monaco.languages.setMonarchTokensProvider('cuda', definition());
export {};
-2
View File
@@ -336,5 +336,3 @@ function configuration(): monaco.languages.LanguageConfiguration {
monaco.languages.register({id: 'd'});
monaco.languages.setMonarchTokensProvider('d', definition());
monaco.languages.setLanguageConfiguration('d', configuration());
export {};
-2
View File
@@ -351,5 +351,3 @@ function definition(): monaco.languages.IMonarchLanguage {
monaco.languages.register({id: 'gccdump-rtl-gimple'});
monaco.languages.setMonarchTokensProvider('gccdump-rtl-gimple', definition());
export {};
-2
View File
@@ -94,5 +94,3 @@ function definition(): monaco.languages.IMonarchLanguage {
monaco.languages.register({id: 'haskell'});
monaco.languages.setMonarchTokensProvider('haskell', definition());
export {};
-2
View File
@@ -180,5 +180,3 @@ function definition(): monaco.languages.IMonarchLanguage {
monaco.languages.register({id: 'hook'});
monaco.languages.setMonarchTokensProvider('hook', definition());
export {};
-2
View File
@@ -179,5 +179,3 @@ function definition(): monaco.languages.IMonarchLanguage {
monaco.languages.register({id: 'hylo'});
monaco.languages.setMonarchTokensProvider('hylo', definition());
monaco.languages.setLanguageConfiguration('hylo', swift.conf);
export {};
-2
View File
@@ -86,5 +86,3 @@ function definition(): monaco.languages.IMonarchLanguage {
monaco.languages.register({id: 'ispc'});
monaco.languages.setLanguageConfiguration('ispc', cpp.conf);
monaco.languages.setMonarchTokensProvider('ispc', definition());
export {};
-2
View File
@@ -206,5 +206,3 @@ function definition(): monaco.languages.IMonarchLanguage {
monaco.languages.register({id: 'jakt'});
monaco.languages.setMonarchTokensProvider('jakt', definition());
export {};
-2
View File
@@ -392,5 +392,3 @@ const config: monaco.languages.LanguageConfiguration = {
monaco.languages.register({id: 'llvm-ir'});
monaco.languages.setMonarchTokensProvider('llvm-ir', definition());
monaco.languages.setLanguageConfiguration('llvm-ir', config);
export {};
-2
View File
@@ -30,5 +30,3 @@ import {definition} from './llvm-ir-mode.js';
monaco.languages.register({id: 'mlir'});
monaco.languages.setMonarchTokensProvider('mlir', definition());
export {};
-2
View File
@@ -119,5 +119,3 @@ function definition(): monaco.languages.IMonarchLanguage {
monaco.languages.register({id: 'modula2'});
monaco.languages.setMonarchTokensProvider('modula2', definition());
export {};
-2
View File
@@ -179,5 +179,3 @@ function definition(): monaco.languages.IMonarchLanguage {
monaco.languages.register({id: 'nim'});
monaco.languages.setMonarchTokensProvider('nim', definition());
export {};
-2
View File
@@ -126,5 +126,3 @@ function definition(): monaco.languages.IMonarchLanguage {
monaco.languages.register({id: 'ocaml'});
monaco.languages.setMonarchTokensProvider('ocaml', definition());
export {};
-2
View File
@@ -143,5 +143,3 @@ function definition(): monaco.languages.IMonarchLanguage {
monaco.languages.register({id: 'openclc'});
monaco.languages.setLanguageConfiguration('openclc', cpp.conf);
monaco.languages.setMonarchTokensProvider('openclc', definition());
export {};
-2
View File
@@ -60,5 +60,3 @@ function definition(): monaco.languages.IMonarchLanguage {
monaco.languages.register({id: 'ptx'});
monaco.languages.setMonarchTokensProvider('ptx', definition());
export {};
-2
View File
@@ -190,5 +190,3 @@ export function definition(): monaco.languages.IMonarchLanguage {
}
monaco.languages.register({id: 'tablegen'});
monaco.languages.setMonarchTokensProvider('tablegen', definition());
export {};

Some files were not shown because too many files have changed in this diff Show More