File tree 3 files changed +22
-1
lines changed
3 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -1612,7 +1612,7 @@ func (c *compiler) Expr(expr ast.Expr) {
1612
1612
// Value Singleton
1613
1613
c .LoadConst (node .Value )
1614
1614
case * ast.Ellipsis :
1615
- panic ( "FIXME compile: Ellipsis not implemented" )
1615
+ c . LoadConst ( py . Ellipsis )
1616
1616
case * ast.Attribute :
1617
1617
// Value Expr
1618
1618
// Attr Identifier
Original file line number Diff line number Diff line change @@ -3824,4 +3824,21 @@ var compileTestData = []struct {
3824
3824
Firstlineno : 1 ,
3825
3825
Lnotab : "" ,
3826
3826
}, nil , "" },
3827
+ {"..." , "exec" , & py.Code {
3828
+ Argcount : 0 ,
3829
+ Kwonlyargcount : 0 ,
3830
+ Nlocals : 0 ,
3831
+ Stacksize : 1 ,
3832
+ Flags : 64 ,
3833
+ Code : "\x64 \x00 \x00 \x01 \x64 \x01 \x00 \x53 " ,
3834
+ Consts : []py.Object {py .Ellipsis , py .None },
3835
+ Names : []string {},
3836
+ Varnames : []string {},
3837
+ Freevars : []string {},
3838
+ Cellvars : []string {},
3839
+ Filename : "<string>" ,
3840
+ Name : "<module>" ,
3841
+ Firstlineno : 1 ,
3842
+ Lnotab : "" ,
3843
+ }, nil , "" },
3827
3844
}
Original file line number Diff line number Diff line change @@ -361,6 +361,8 @@ def f():
361
361
def f():
362
362
yield from range(10)
363
363
''' , "exec" ),
364
+ # ellipsis
365
+ ('''...''' , "exec" ),
364
366
]
365
367
366
368
def string (s ):
@@ -419,6 +421,8 @@ def const(x):
419
421
])
420
422
elif x is None :
421
423
return 'py.None'
424
+ elif x is ...:
425
+ return 'py.Ellipsis'
422
426
else :
423
427
raise AssertionError ("Unknown const %r" % x )
424
428
You can’t perform that action at this time.
0 commit comments