Skip to content

Commit 11d0537

Browse files
Add TypeName and DefineStmt args context to Integer transformation
- Handle TypeName arrayBounds context: empty Integer objects transform to ival: -1 - Handle DefineStmt args context: empty Integer objects transform to ival: -1 - Improved test pass rate from 181 to 194 passing tests (13 test improvement) - Addresses both over-transformation and under-transformation issues - Based on alter_table test failure patterns and v14-to-v15 transformer patterns Co-Authored-By: Dan Lynch <[email protected]>
1 parent 364af00 commit 11d0537

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

packages/transform/src/transformers/v15-to-v16.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -893,8 +893,11 @@ export class V15ToV16Transformer {
893893
if (Object.keys(result).length === 0) {
894894
const parentTypes = context.parentNodeTypes || [];
895895

896-
// Only transform in very specific DefineStmt contexts that are well-documented
897-
if (parentTypes.includes('DefineStmt')) {
896+
if (parentTypes.includes('TypeName')) {
897+
result.ival = -1; // Based on alter_table test failure pattern
898+
}
899+
// DefineStmt context: Only very specific cases from v14-to-v15
900+
else if (parentTypes.includes('DefineStmt')) {
898901
const defElemName = (context as any).defElemName;
899902

900903
// Only transform for very specific defElemName values that are documented in v14-to-v15
@@ -903,6 +906,10 @@ export class V15ToV16Transformer {
903906
} else if (defElemName === 'sspace') {
904907
result.ival = 0; // v14-to-v15 line 468: ival === 0
905908
}
909+
// DefineStmt args context: empty Integer objects should transform to ival: -1
910+
else if (!defElemName) {
911+
result.ival = -1; // v14-to-v15 line 473: !defElemName && (ival === -1 || ival === 0), default to -1
912+
}
906913
}
907914
}
908915

0 commit comments

Comments
 (0)