Skip to content

Commit e7d34fd

Browse files
committed
[GR-23201] Call literal `**' binary operation with two arguments only
PullRequest: graalpython/947
2 parents b845606 + 568e805 commit e7d34fd

File tree

23 files changed

+66
-135
lines changed

23 files changed

+66
-135
lines changed

docs/contributor/CONTRIBUTING.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,14 @@ print its path as the last output, if successful.
168168

169169
mx python-svm
170170

171+
If you made changes to the parser, you may have to regenerate the golden files
172+
like so:
173+
174+
find graalpython -name *.scope -delete
175+
find graalpython -name *.tast -delete
176+
mx punittest com.oracle.graal.python.test.parser
177+
178+
171179
### Benchmarking
172180

173181
We use the `mx` facilities for benchmarking. Use this to list the available
Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +0,0 @@
1-
*AugAssignTest.testBasic
2-
*AugAssignTest.testCustomMethods1
3-
*AugAssignTest.testInDict
4-
*AugAssignTest.testInList
5-
*AugAssignTest.testSequences
6-
*AugAssignTest.test_with_unpacking

graalpython/com.oracle.graal.python.test/testData/goldenFiles/BasicTests/binaryOp03.tast

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ ModuleRootNode Name: <module 'binaryOp03'> SourceSection: [0,6]`3 ** 2`
55
FrameDescriptor: Empty
66
Documentation: None
77
InnerRootNode SourceSection: [0,6]`3 ** 2`
8-
TernaryArithmeticExpression SourceSection: [0,6]`3 ** 2`
9-
LookupAndCallTernaryNodeGen SourceSection: None
10-
CallTernaryMethodCachedNodeGen SourceSection: None
8+
BinaryArithmeticExpression SourceSection: [0,6]`3 ** 2`
9+
LookupAndCallBinaryNodeGen SourceSection: None
10+
Op: __pow__
1111
IntegerLiteralNode SourceSection: [0,1]`3`
1212
Value: 3
1313
IntegerLiteralNode SourceSection: [5,6]`2`

graalpython/com.oracle.graal.python.test/testData/goldenFiles/BasicTests/binaryOp04.tast

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ ModuleRootNode Name: <module 'binaryOp04'> SourceSection: [0,11]`3 ** 2 ** 2`
55
FrameDescriptor: Empty
66
Documentation: None
77
InnerRootNode SourceSection: [0,11]`3 ** 2 ** 2`
8-
TernaryArithmeticExpression SourceSection: [0,11]`3 ** 2 ** 2`
9-
LookupAndCallTernaryNodeGen SourceSection: None
10-
CallTernaryMethodCachedNodeGen SourceSection: None
8+
BinaryArithmeticExpression SourceSection: [0,11]`3 ** 2 ** 2`
9+
LookupAndCallBinaryNodeGen SourceSection: None
10+
Op: __pow__
1111
IntegerLiteralNode SourceSection: [0,1]`3`
1212
Value: 3
13-
TernaryArithmeticExpression SourceSection: [5,11]`2 ** 2`
14-
LookupAndCallTernaryNodeGen SourceSection: None
15-
CallTernaryMethodCachedNodeGen SourceSection: None
13+
BinaryArithmeticExpression SourceSection: [5,11]`2 ** 2`
14+
LookupAndCallBinaryNodeGen SourceSection: None
15+
Op: __pow__
1616
IntegerLiteralNode SourceSection: [5,6]`2`
1717
Value: 2
1818
IntegerLiteralNode SourceSection: [10,11]`2`

graalpython/com.oracle.graal.python.test/testData/goldenFiles/ExpressionsFromCPTests/dictComprehensions02.tast

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ ModuleRootNode Name: <module 'dictComprehensions02'> SourceSection: [0,40]`{x**2
4545
YieldNode SourceSection: None
4646
flagSlot: 0
4747
TupleLiteralNode SourceSection: None
48-
TernaryArithmeticExpression SourceSection: [1,5]`x**2`
49-
LookupAndCallTernaryNodeGen SourceSection: None
50-
CallTernaryMethodCachedNodeGen SourceSection: None
48+
BinaryArithmeticExpression SourceSection: [1,5]`x**2`
49+
LookupAndCallBinaryNodeGen SourceSection: None
50+
Op: __pow__
5151
ReadGeneratorFrameVariableNode SourceSection: [1,2]`x`
5252
Frame: [0,x,Illegal]
5353
ReadVariableFromFrameNodeGen SourceSection: None

graalpython/com.oracle.graal.python.test/testData/goldenFiles/ExpressionsFromCPTests/generator01.tast

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ ModuleRootNode Name: <module 'generator01'> SourceSection: [0,25]`[x**3 for x in
3333
ExpressionStatementNode SourceSection: [1,5]`x**3`
3434
YieldNode SourceSection: [1,5]`x**3`
3535
flagSlot: 0
36-
TernaryArithmeticExpression SourceSection: [1,5]`x**3`
37-
LookupAndCallTernaryNodeGen SourceSection: None
38-
CallTernaryMethodCachedNodeGen SourceSection: None
36+
BinaryArithmeticExpression SourceSection: [1,5]`x**3`
37+
LookupAndCallBinaryNodeGen SourceSection: None
38+
Op: __pow__
3939
ReadGeneratorFrameVariableNode SourceSection: [1,2]`x`
4040
Frame: [0,x,Illegal]
4141
ReadVariableFromFrameNodeGen SourceSection: None

graalpython/com.oracle.graal.python.test/testData/goldenFiles/ExpressionsFromCPTests/generator02.tast

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ ModuleRootNode Name: <module 'generator02'> SourceSection: [0,34]`[x**3 for x in
4444
ExpressionStatementNode SourceSection: [1,5]`x**3`
4545
YieldNode SourceSection: [1,5]`x**3`
4646
flagSlot: 0
47-
TernaryArithmeticExpression SourceSection: [1,5]`x**3`
48-
LookupAndCallTernaryNodeGen SourceSection: None
49-
CallTernaryMethodCachedNodeGen SourceSection: None
47+
BinaryArithmeticExpression SourceSection: [1,5]`x**3`
48+
LookupAndCallBinaryNodeGen SourceSection: None
49+
Op: __pow__
5050
ReadGeneratorFrameVariableNode SourceSection: [1,2]`x`
5151
Frame: [0,x,Illegal]
5252
ReadVariableFromFrameNodeGen SourceSection: None

graalpython/com.oracle.graal.python.test/testData/goldenFiles/ExpressionsFromCPTests/generator03.tast

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ ModuleRootNode Name: <module 'generator03'> SourceSection: [0,43]`[x**3 for x in
5454
ExpressionStatementNode SourceSection: [1,5]`x**3`
5555
YieldNode SourceSection: [1,5]`x**3`
5656
flagSlot: 0
57-
TernaryArithmeticExpression SourceSection: [1,5]`x**3`
58-
LookupAndCallTernaryNodeGen SourceSection: None
59-
CallTernaryMethodCachedNodeGen SourceSection: None
57+
BinaryArithmeticExpression SourceSection: [1,5]`x**3`
58+
LookupAndCallBinaryNodeGen SourceSection: None
59+
Op: __pow__
6060
ReadGeneratorFrameVariableNode SourceSection: [1,2]`x`
6161
Frame: [0,x,Illegal]
6262
ReadVariableFromFrameNodeGen SourceSection: None

graalpython/com.oracle.graal.python.test/testData/goldenFiles/ExpressionsFromCPTests/generator04.tast

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ ModuleRootNode Name: <module 'generator04'> SourceSection: [0,29]`list(x**3 for
3333
ExpressionStatementNode SourceSection: [5,9]`x**3`
3434
YieldNode SourceSection: [5,9]`x**3`
3535
flagSlot: 0
36-
TernaryArithmeticExpression SourceSection: [5,9]`x**3`
37-
LookupAndCallTernaryNodeGen SourceSection: None
38-
CallTernaryMethodCachedNodeGen SourceSection: None
36+
BinaryArithmeticExpression SourceSection: [5,9]`x**3`
37+
LookupAndCallBinaryNodeGen SourceSection: None
38+
Op: __pow__
3939
ReadGeneratorFrameVariableNode SourceSection: [5,6]`x`
4040
Frame: [0,x,Illegal]
4141
ReadVariableFromFrameNodeGen SourceSection: None

graalpython/com.oracle.graal.python.test/testData/goldenFiles/ExpressionsFromCPTests/generator05.tast

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ ModuleRootNode Name: <module 'generator05'> SourceSection: [0,38]`list(x**3 for
4444
ExpressionStatementNode SourceSection: [5,9]`x**3`
4545
YieldNode SourceSection: [5,9]`x**3`
4646
flagSlot: 0
47-
TernaryArithmeticExpression SourceSection: [5,9]`x**3`
48-
LookupAndCallTernaryNodeGen SourceSection: None
49-
CallTernaryMethodCachedNodeGen SourceSection: None
47+
BinaryArithmeticExpression SourceSection: [5,9]`x**3`
48+
LookupAndCallBinaryNodeGen SourceSection: None
49+
Op: __pow__
5050
ReadGeneratorFrameVariableNode SourceSection: [5,6]`x`
5151
Frame: [0,x,Illegal]
5252
ReadVariableFromFrameNodeGen SourceSection: None

0 commit comments

Comments
 (0)