Skip to content

Commit b4f9a00

Browse files
committed
Fixed style
1 parent 90a76a0 commit b4f9a00

File tree

4 files changed

+8
-8
lines changed
  • graalpython

4 files changed

+8
-8
lines changed

graalpython/com.oracle.graal.python.pegparser.generator/pegjava/java_generator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@ def __str__(self) -> str:
186186
'CHECK_VERSION ( stmt_ty , 5 , "Async for loops are" , _PyAST_AsyncFor ( t , ex , b , el , NEW_TYPE_COMMENT ( p , tc ) , EXTRA ) )': (1, 'checkVersion(5, "Async for loops are", factory.createAsyncFor(t, ex, b, el, newTypeComment(tc), $RANGE))'),
187187
'CHECK_VERSION ( stmt_ty , 5 , "Async with statements are" , _PyAST_AsyncWith ( a , b , NULL , EXTRA ) )': (1, 'checkVersion(5, "Async with statements are", factory.createAsyncWith(a, b, null, $RANGE))'),
188188
'CHECK_VERSION ( stmt_ty , 5 , "Async with statements are" , _PyAST_AsyncWith ( a , b , NEW_TYPE_COMMENT ( p , tc ) , EXTRA ) )': (1, 'checkVersion(5, "Async with statements are", factory.createAsyncWith(a, b, newTypeComment(tc), $RANGE))'),
189-
'CHECK_VERSION ( stmt_ty , 6 , "Variable annotation syntax is" , _PyAST_AnnAssign ( CHECK ( expr_ty , _PyPegen_set_expr_context ( p , a , Store ) ) , b , c , 1 , EXTRA ) )': (1, 'factory.createAnnAssignment(setExprContext(a, ExprContextTy.Store), b, (ExprTy) c, true, $RANGE);'),
190-
'CHECK_VERSION ( stmt_ty , 6 , "Variable annotations syntax is" , _PyAST_AnnAssign ( a , b , c , 0 , EXTRA ) )': (1, 'factory.createAnnAssignment(a, b, (ExprTy) c, false, $RANGE);'),
189+
'CHECK_VERSION ( stmt_ty , 6 , "Variable annotation syntax is" , _PyAST_AnnAssign ( CHECK ( expr_ty , _PyPegen_set_expr_context ( p , a , Store ) ) , b , c , 1 , EXTRA ) )': (1, 'factory.createAnnAssignment(setExprContext(a, ExprContextTy.Store), b, (ExprTy) c, true, $RANGE)'),
190+
'CHECK_VERSION ( stmt_ty , 6 , "Variable annotations syntax is" , _PyAST_AnnAssign ( a , b , c , 0 , EXTRA ) )': (1, 'factory.createAnnAssignment(a, b, (ExprTy) c, false, $RANGE)'),
191191
'CHECK_VERSION ( comprehension_ty , 6 , "Async comprehensions are" , _PyAST_comprehension ( a , b , c , 1 , p -> arena ) )': (1, 'checkVersion(6, "Async comprehensions are", factory.createComprehension(a, b, c, false, $RANGE))'),
192192
'RAISE_ERROR_KNOWN_LOCATION ( p , PyExc_SyntaxError , a -> lineno , a -> end_col_offset - 1 , a -> end_lineno , - 1 , "\':\' expected after dictionary key" )' : (1, 'this.raiseErrorKnownLocation(ErrorCallback.ErrorType.Syntax, a, "\':\' expected after dictionary key")'),
193193
'RAISE_SYNTAX_ERROR_INVALID_TARGET ( DEL_TARGETS , a )': (1, 'this.raiseSyntaxErrorInvalidTarget(TargetsType.DEL_TARGETS,a)'),
@@ -250,7 +250,7 @@ def __str__(self) -> str:
250250
'_PyAST_Try ( b , NULL , NULL , f , EXTRA )': (1, 'factory.createTry(b, null, null, f, $LOC)'),
251251
'_PyAST_Try ( b , ex , el , f , EXTRA )': (1, 'factory.createTry(b, ex, el, f, $LOC)'),
252252
'_PyAST_Tuple ( CHECK ( asdl_expr_seq * , _PyPegen_seq_insert_in_front ( p , a , b ) ) , Load , EXTRA )': (2, 'factory.createTuple(this.insertInFront(a, b), ExprContextTy.Load, $RANGE)'),
253-
'_PyAST_Tuple ( CHECK ( asdl_expr_seq * , _PyPegen_seq_insert_in_front ( p , a , b ) ) , Store , EXTRA )': (1, 'factory.createTuple(this.insertInFront(a,b), ExprContextTy.Store, $RANGE);'),
253+
'_PyAST_Tuple ( CHECK ( asdl_expr_seq * , _PyPegen_seq_insert_in_front ( p , a , b ) ) , Store , EXTRA )': (1, 'factory.createTuple(this.insertInFront(a,b), ExprContextTy.Store, $RANGE)'),
254254
'_PyAST_Tuple ( CHECK ( asdl_expr_seq * , _PyPegen_singleton_seq ( p , a ) ) , Load , EXTRA )': (2, 'factory.createTuple(new ExprTy[] {a}, ExprContextTy.Load, $RANGE)'),
255255
'_PyAST_While ( a , b , c , EXTRA )': (1, 'factory.createWhile(a, b, c, $RANGE)'),
256256
'_PyAST_With ( a , b , NEW_TYPE_COMMENT ( p , tc ) , EXTRA )': (1, 'factory.createWith(a, b, newTypeComment(tc), $RANGE)'),

graalpython/com.oracle.graal.python.pegparser.test/src/com/oracle/graal/python/pegparser/sst/SSTTreePrinterVisitor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ public String visit(ExprTy.Constant node) {
257257
return sb.toString();
258258
}
259259

260-
private void appendConstantValue(StringBuilder sb, ConstantValue value) {
260+
private static void appendConstantValue(StringBuilder sb, ConstantValue value) {
261261
switch (value.kind) {
262262
case BIGINTEGER:
263263
sb.append(value.getBigInteger());

graalpython/com.oracle.graal.python.pegparser/src/com/oracle/graal/python/pegparser/Parser.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1681,7 +1681,7 @@ public StmtTy assignment_rule()
16811681
if (endToken == null) {
16821682
return null;
16831683
}
1684-
_res = factory.createAnnAssignment(setExprContext(a, ExprContextTy.Store), b, (ExprTy) c, true, startToken.sourceRange.withEnd(endToken.sourceRange));;
1684+
_res = factory.createAnnAssignment(setExprContext(a, ExprContextTy.Store), b, (ExprTy) c, true, startToken.sourceRange.withEnd(endToken.sourceRange));
16851685
cache.putResult(_mark, ASSIGNMENT_ID, _res);
16861686
return (StmtTy)_res;
16871687
}
@@ -1709,7 +1709,7 @@ public StmtTy assignment_rule()
17091709
if (endToken == null) {
17101710
return null;
17111711
}
1712-
_res = factory.createAnnAssignment(a, b, (ExprTy) c, false, startToken.sourceRange.withEnd(endToken.sourceRange));;
1712+
_res = factory.createAnnAssignment(a, b, (ExprTy) c, false, startToken.sourceRange.withEnd(endToken.sourceRange));
17131713
cache.putResult(_mark, ASSIGNMENT_ID, _res);
17141714
return (StmtTy)_res;
17151715
}
@@ -11573,7 +11573,7 @@ public ExprTy star_targets_rule()
1157311573
if (endToken == null) {
1157411574
return null;
1157511575
}
11576-
_res = factory.createTuple(this.insertInFront(a,b), ExprContextTy.Store, startToken.sourceRange.withEnd(endToken.sourceRange));;
11576+
_res = factory.createTuple(this.insertInFront(a,b), ExprContextTy.Store, startToken.sourceRange.withEnd(endToken.sourceRange));
1157711577
cache.putResult(_mark, STAR_TARGETS_ID, _res);
1157811578
return (ExprTy)_res;
1157911579
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/compiler/Compiler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1199,7 +1199,7 @@ public Void visit(ExprTy.Constant node) {
11991199
try {
12001200
switch (node.value.kind) {
12011201
case ARBITRARY_PYTHON_OBJECT:
1202-
// TODO GR-40165: avoid sharing this code
1202+
// TODO GR-40165: the code object being compiled must not be shared
12031203
return addOp(LOAD_CONST, addObject(unit.constants, node.value.getArbitraryPythonObject()));
12041204
case NONE:
12051205
return addOp(LOAD_NONE);

0 commit comments

Comments
 (0)