Skip to content

Commit

Permalink
remove needarg
Browse files Browse the repository at this point in the history
  • Loading branch information
PolyProgrammist committed Dec 22, 2023
1 parent d160020 commit 05c6f16
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/codegen/generators/typescript/field_handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export function handleField(field: TLBField, fieldDefinition: FieldDefinition, s
}

let thefield = getType(fieldDefinition.expr, fieldName, true, false, variableCombinatorName, variableSubStructName, constructor, tmpTypeName, 0, tlbCode);
let fieldInfo = handleType(thefield, fieldName, true, false, variableCombinatorName, variableSubStructName, currentSlice, currentCell, constructor, jsCodeFunctionsDeclarations, tmpTypeName, 0, tlbCode, subStructLoadProperties);
let fieldInfo = handleType(thefield, fieldName, true, variableCombinatorName, variableSubStructName, currentSlice, currentCell, constructor, jsCodeFunctionsDeclarations, tmpTypeName, 0, tlbCode, subStructLoadProperties);
if (fieldInfo.loadExpr) {
addLoadProperty(goodVariableName(fieldName), fieldInfo.loadExpr, fieldInfo.typeParamExpr, constructorLoadStatements, subStructLoadProperties);
}
Expand Down
10 changes: 5 additions & 5 deletions src/codegen/generators/typescript/type_handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function isBigInt(fieldType: TLBNumberType) {
return true;
}

export function handleType(fieldType: TLBFieldType, fieldName: string, isField: boolean, needArg: boolean, variableCombinatorName: string, variableSubStructName: string, currentSlice: string, currentCell: string, constructor: TLBConstructor, jsCodeFunctionsDeclarations: GenDeclaration[], fieldTypeName: string, argIndex: number, tlbCode: TLBCode, subStructLoadProperties: ObjectProperty[]): FieldInfoType {
export function handleType(fieldType: TLBFieldType, fieldName: string, isField: boolean, variableCombinatorName: string, variableSubStructName: string, currentSlice: string, currentCell: string, constructor: TLBConstructor, jsCodeFunctionsDeclarations: GenDeclaration[], fieldTypeName: string, argIndex: number, tlbCode: TLBCode, subStructLoadProperties: ObjectProperty[]): FieldInfoType {
let theSlice = 'slice'; // TODO: use slice from field
let theCell = 'builder';
if (isField) {
Expand Down Expand Up @@ -103,7 +103,7 @@ export function handleType(fieldType: TLBFieldType, fieldName: string, isField:
} else if (fieldType.kind == 'TLBCondType') {
let subExprInfo: FieldInfoType
let conditionExpr: Expression;
subExprInfo = handleType(fieldType.value, fieldName, true, false, variableCombinatorName, variableSubStructName, currentSlice, currentCell, constructor, jsCodeFunctionsDeclarations, fieldTypeName, argIndex, tlbCode, subStructLoadProperties);
subExprInfo = handleType(fieldType.value, fieldName, true, variableCombinatorName, variableSubStructName, currentSlice, currentCell, constructor, jsCodeFunctionsDeclarations, fieldTypeName, argIndex, tlbCode, subStructLoadProperties);
conditionExpr = convertToAST(fieldType.condition, constructor, true)
if (subExprInfo.typeParamExpr) {
result.typeParamExpr = tUnionTypeExpression([subExprInfo.typeParamExpr, tIdentifier('undefined')])
Expand All @@ -121,7 +121,7 @@ export function handleType(fieldType: TLBFieldType, fieldName: string, isField:
let arrayLength: Expression
let subExprInfo: FieldInfoType
arrayLength = convertToAST(fieldType.times, constructor, true);
subExprInfo = handleType(fieldType.value, fieldName, false, needArg, variableCombinatorName, variableSubStructName, currentSlice, currentCell, constructor, jsCodeFunctionsDeclarations, fieldTypeName, argIndex, tlbCode, subStructLoadProperties);
subExprInfo = handleType(fieldType.value, fieldName, false, variableCombinatorName, variableSubStructName, currentSlice, currentCell, constructor, jsCodeFunctionsDeclarations, fieldTypeName, argIndex, tlbCode, subStructLoadProperties);
let currentParam = insideStoreParameters[0]
let currentParam2 = insideStoreParameters2[0]
if (subExprInfo.loadExpr) {
Expand All @@ -141,7 +141,7 @@ export function handleType(fieldType: TLBFieldType, fieldName: string, isField:
let currentCell = getCurrentSlice([1, 0], 'cell');

let subExprInfo: FieldInfoType;
subExprInfo = handleType(fieldType.value, fieldName, true, true, variableCombinatorName, variableSubStructName, currentSlice, currentCell, constructor, jsCodeFunctionsDeclarations, fieldTypeName, argIndex, tlbCode, subStructLoadProperties)
subExprInfo = handleType(fieldType.value, fieldName, true, variableCombinatorName, variableSubStructName, currentSlice, currentCell, constructor, jsCodeFunctionsDeclarations, fieldTypeName, argIndex, tlbCode, subStructLoadProperties)
if (subExprInfo.loadExpr) {
result.typeParamExpr = subExprInfo.typeParamExpr;
result.storeExpr = subExprInfo.storeExpr;
Expand Down Expand Up @@ -173,7 +173,7 @@ export function handleType(fieldType: TLBFieldType, fieldName: string, isField:
if (fieldType.kind == 'TLBNamedType') {
fieldType.arguments.forEach(arg => {
argIndex++;
let subExprInfo = handleType(arg, fieldName, false, needArg, variableCombinatorName, variableSubStructName, currentSlice, currentCell, constructor, jsCodeFunctionsDeclarations, fieldTypeName, argIndex, tlbCode, subStructLoadProperties);
let subExprInfo = handleType(arg, fieldName, false, variableCombinatorName, variableSubStructName, currentSlice, currentCell, constructor, jsCodeFunctionsDeclarations, fieldTypeName, argIndex, tlbCode, subStructLoadProperties);
if (subExprInfo.typeParamExpr) {
typeExpression.typeParameters.push(subExprInfo.typeParamExpr);
}
Expand Down

0 comments on commit 05c6f16

Please sign in to comment.