Skip to content

Commit

Permalink
Adjusted the intermediate creator test utility for the structures.
Browse files Browse the repository at this point in the history
  • Loading branch information
BenediktMagnus committed Feb 23, 2024
1 parent 4383809 commit 2810fc2
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion tests/utility/intermediateCreator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ export abstract class IntermediateCreator
externals: Intermediates.External[] = [],
constants: Intermediates.Constant[] = [],
globals: Intermediates.Global[] = [],
structure: Intermediates.Structure = IntermediateCreator.newStructure(),
isEntryPoint = false
): Intermediates.File
{
return new Intermediates.File(constants, externals, globals, functions, isEntryPoint);
return new Intermediates.File(constants, externals, globals, functions, structure, isEntryPoint);
}

public static newFunction (
Expand All @@ -33,6 +34,21 @@ export abstract class IntermediateCreator
return new IntermediateSymbols.Function(name, returnSize, parameters);
}

public static newStructure (
symbol: IntermediateSymbols.Structure = IntermediateCreator.newStructureSymbol()
): Intermediates.Structure
{
return new Intermediates.Structure(symbol);
}

public static newStructureSymbol (
name = Defaults.identifier,
fields: IntermediateSymbols.Field[] = []
): IntermediateSymbols.Structure
{
return new IntermediateSymbols.Structure(name, fields);
}

public static newReturn (): Intermediates.Return
{
return new Intermediates.Return();
Expand Down

0 comments on commit 2810fc2

Please sign in to comment.