@@ -239,8 +239,9 @@ public Object visitEval_input(Python3Parser.Eval_inputContext ctx) {
239
239
deriveSourceSection (ctx , node );
240
240
StatementNode evalReturn = factory .createFrameReturn (factory .createWriteLocal (node , environment .getReturnSlot ()));
241
241
ReturnTargetNode returnTarget = new ReturnTargetNode (evalReturn , factory .createReadLocal (environment .getReturnSlot ()));
242
+ FunctionRootNode functionRoot = factory .createFunctionRoot (node .getSourceSection (), name , false , ctx .scope .getFrameDescriptor (), returnTarget , environment .getExecutionCellSlots ());
242
243
environment .leaveScope ();
243
- return factory . createFunctionRoot ( node . getSourceSection (), name , false , ctx . scope . getFrameDescriptor (), returnTarget , environment . getExecutionCellSlots ()) ;
244
+ return functionRoot ;
244
245
}
245
246
246
247
@ Override
@@ -1505,19 +1506,19 @@ public Args visitArgs(String functionName, ParserRuleContext ctx) {
1505
1506
argname = ((Python3Parser .VdefparameterContext ) child ).vfpdef ().NAME ().getText ();
1506
1507
test = ((Python3Parser .VdefparameterContext ) child ).test ();
1507
1508
} else if (child instanceof Python3Parser .SplatparameterContext ) {
1508
- varargsSeen = true ;
1509
1509
Python3Parser .SplatparameterContext splat = (Python3Parser .SplatparameterContext ) child ;
1510
1510
argname = splat .tfpdef () == null ? null : splat .tfpdef ().NAME ().getText ();
1511
1511
if (argname != null ) {
1512
+ varargsSeen = true ;
1512
1513
argumentReadNode = environment .getWriteVarArgsToLocal (argname );
1513
1514
} else {
1514
1515
starArgsMarker = true ;
1515
1516
}
1516
1517
} else if (child instanceof Python3Parser .VsplatparameterContext ) {
1517
- varargsSeen = true ;
1518
1518
Python3Parser .VsplatparameterContext splat = (Python3Parser .VsplatparameterContext ) child ;
1519
1519
argname = splat .vfpdef () == null ? null : splat .vfpdef ().NAME ().getText ();
1520
1520
if (argname != null ) {
1521
+ varargsSeen = true ;
1521
1522
argumentReadNode = environment .getWriteVarArgsToLocal (argname );
1522
1523
} else {
1523
1524
starArgsMarker = true ;
@@ -1537,16 +1538,15 @@ public Args visitArgs(String functionName, ParserRuleContext ctx) {
1537
1538
if (test != null ) {
1538
1539
ReadDefaultArgumentNode readDefaultArgumentNode = new ReadDefaultArgumentNode ();
1539
1540
defaultReads .add (readDefaultArgumentNode );
1540
- if (!varargsSeen ) {
1541
+ if (!varargsSeen && ! starArgsMarker ) {
1541
1542
argumentReadNode = environment .getWriteKeywordArgumentToLocal (argname , readDefaultArgumentNode );
1542
- arityKeywordNames .add (new Arity .KeywordName (argname , false ));
1543
1543
maxNumPosArgs ++;
1544
1544
} else {
1545
1545
argumentReadNode = environment .getWriteRequiredKeywordArgumentToLocal (argname , readDefaultArgumentNode );
1546
- arityKeywordNames .add (new Arity .KeywordName (argname , false ));
1547
1546
}
1547
+ arityKeywordNames .add (new Arity .KeywordName (argname , false ));
1548
1548
keywordNames .add (argname );
1549
- } else if (varargsSeen ) {
1549
+ } else if (varargsSeen || starArgsMarker ) {
1550
1550
argumentReadNode = environment .getWriteRequiredKeywordArgumentToLocal (argname );
1551
1551
arityKeywordNames .add (new Arity .KeywordName (argname , true ));
1552
1552
keywordNames .add (argname );
0 commit comments