Skip to content

Commit aa05e60

Browse files
committed
Normalize "[,]" (GAP 4.11) to "MatElm" (GAP 4.12)
1 parent ad5241b commit aa05e60

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

CompilerForCAP/examples/MatElm.g

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#! @Chapter Examples and tests
2+
3+
#! @Section Tests
4+
5+
LoadPackage( "CompilerForCAP", false );
6+
7+
#! @Example
8+
9+
func := x -> x[1,1];;
10+
tree := ENHANCED_SYNTAX_TREE( func );;
11+
tree := CapJitResolvedGlobalVariables( tree );;
12+
Display( ENHANCED_SYNTAX_TREE_CODE( tree ) );
13+
#! function ( x_1 )
14+
#! return MatElm( x_1, 1, 1 );
15+
#! end
16+
17+
#! @EndExample

CompilerForCAP/gap/EnhancedSyntaxTree.gi

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,6 +1193,19 @@ InstallGlobalFunction( ENHANCED_SYNTAX_TREE_CODE, function ( tree )
11931193

11941194
fi;
11951195

1196+
# normalize "[,]" (GAP 4.11) to "MatElm" (GAP 4.12)
1197+
if tree.type = "EXPR_REF_GVAR" and tree.gvar = "[,]" then
1198+
1199+
# this code is only executed with GAP 4.11, but coverage information is only uploaded for GAP master
1200+
Assert( 0, IsIdenticalObj( \[\,\], MatElm ) );
1201+
1202+
tree := rec(
1203+
type := "EXPR_REF_GVAR",
1204+
gvar := "MatElm",
1205+
);
1206+
1207+
fi;
1208+
11961209
fi;
11971210

11981211
return tree;

0 commit comments

Comments
 (0)