@@ -19,6 +19,7 @@ use crate::obj::objbytes;
1919use crate :: obj:: objcode;
2020use crate :: obj:: objcomplex:: { self , PyComplex } ;
2121use crate :: obj:: objdict;
22+ use crate :: obj:: objellipsis;
2223use crate :: obj:: objenumerate;
2324use crate :: obj:: objfilter;
2425use crate :: obj:: objfloat:: { self , PyFloat } ;
@@ -115,6 +116,7 @@ pub struct PyContext {
115116pub classmethod_type : PyObjectRef ,
116117pub code_type : PyObjectRef ,
117118pub dict_type : PyObjectRef ,
119+ pub ellipsis_type : PyObjectRef ,
118120pub enumerate_type : PyObjectRef ,
119121pub filter_type : PyObjectRef ,
120122pub float_type : PyObjectRef ,
@@ -130,6 +132,7 @@ pub struct PyContext {
130132pub map_type : PyObjectRef ,
131133pub memoryview_type : PyObjectRef ,
132134pub none : PyObjectRef ,
135+ pub ellipsis : PyObjectRef ,
133136pub not_implemented : PyObjectRef ,
134137pub tuple_type : PyObjectRef ,
135138pub set_type : PyObjectRef ,
@@ -207,6 +210,7 @@ impl PyContext {
207210let bytearray_type =create_type ( "bytearray" , & type_type, & object_type, & dict_type) ;
208211let tuple_type =create_type ( "tuple" , & type_type, & object_type, & dict_type) ;
209212let iter_type =create_type ( "iter" , & type_type, & object_type, & dict_type) ;
213+ let ellipsis_type =create_type ( "EllipsisType" , & type_type, & object_type, & dict_type) ;
210214let enumerate_type =create_type ( "enumerate" , & type_type, & object_type, & dict_type) ;
211215let filter_type =create_type ( "filter" , & type_type, & object_type, & dict_type) ;
212216let map_type =create_type ( "map" , & type_type, & object_type, & dict_type) ;
@@ -223,6 +227,8 @@ impl PyContext {
223227create_type ( "NoneType" , & type_type, & object_type, & dict_type) ,
224228) ;
225229
230+ let ellipsis =PyObject :: new ( PyObjectPayload :: None , ellipsis_type. clone ( ) ) ;
231+
226232let not_implemented =PyObject :: new (
227233PyObjectPayload :: NotImplemented ,
228234create_type ( "NotImplementedType" , & type_type, & object_type, & dict_type) ,
@@ -257,12 +263,14 @@ impl PyContext {
257263 false_value,
258264 tuple_type,
259265 iter_type,
266+ ellipsis_type,
260267 enumerate_type,
261268 filter_type,
262269 map_type,
263270 zip_type,
264271 dict_type,
265272 none,
273+ ellipsis,
266274 not_implemented,
267275 str_type,
268276 range_type,
@@ -300,6 +308,7 @@ impl PyContext {
300308 objsuper:: init ( & context) ;
301309 objtuple:: init ( & context) ;
302310 objiter:: init ( & context) ;
311+ objellipsis:: init ( & context) ;
303312 objenumerate:: init ( & context) ;
304313 objfilter:: init ( & context) ;
305314 objmap:: init ( & context) ;
@@ -441,6 +450,11 @@ impl PyContext {
441450pub fn none ( & self ) ->PyObjectRef {
442451self . none . clone ( )
443452}
453+
454+ pub fn ellipsis ( & self ) ->PyObjectRef {
455+ self . ellipsis . clone ( )
456+ }
457+
444458pub fn not_implemented ( & self ) ->PyObjectRef {
445459self . not_implemented . clone ( )
446460}
@@ -699,6 +713,7 @@ impl PyContext {
699713self . new_tuple ( elements)
700714}
701715 bytecode:: Constant :: None =>self . none ( ) ,
716+ bytecode:: Constant :: Ellipsis =>self . ellipsis ( ) ,
702717}
703718}
704719}