소스 검색

remove some TODOs

blueloveTH 2 년 전
부모
커밋
5dcd7febe7
3개의 변경된 파일1개의 추가작업 그리고 5개의 파일을 삭제
  1. 0 1
      src/compiler.h
  2. 0 2
      src/str.h
  3. 1 2
      src/vm.h

+ 0 - 1
src/compiler.h

@@ -934,7 +934,6 @@ public:
         this->lexer = std::make_unique<Lexer>(
             make_sp<SourceData>(source, filename, mode)
         );
-        // TODO: check if already initialized
         init_pratt_rules();
     }
 

+ 0 - 2
src/str.h

@@ -6,7 +6,6 @@
 
 namespace pkpy {
 
-// TODO: check error if return 0
 inline int utf8len(unsigned char c, bool suppress=false){
     if((c & 0b10000000) == 0) return 1;
     if((c & 0b11100000) == 0b11000000) return 2;
@@ -244,7 +243,6 @@ struct Str{
 
     /*************unicode*************/
 
-    // TODO: check error
     int _unicode_index_to_byte(int i) const{
         if(is_ascii) return i;
         int j = 0;

+ 1 - 2
src/vm.h

@@ -736,6 +736,7 @@ inline PyObject* VM::call(PyObject* callable, Args args, const Args& kwargs, boo
     }
 
     if(is_type(callable, tp_type)){
+        // TODO: use get_unbound_method here
         PyObject* new_f = callable->attr().try_get(__new__);
         PyObject* obj;
         if(new_f != nullptr){
@@ -776,7 +777,6 @@ inline void VM::unpack_args(Args& args){
 
 // https://docs.python.org/3/howto/descriptor.html#invocation-from-an-instance
 inline PyObject* VM::getattr(PyObject* obj, StrName name, bool throw_err){
-    // TODO: class_only impl may not be correct
     PyObject* objtype = _t(obj);
     // handle super() proxy
     if(is_type(obj, tp_super)){
@@ -810,7 +810,6 @@ inline PyObject* VM::getattr(PyObject* obj, StrName name, bool throw_err){
 // try to load a unbound method (fallback to `getattr` if not found)
 inline PyObject* VM::get_unbound_method(PyObject* obj, StrName name, PyObject** self, bool throw_err, bool fallback){
     *self = _py_null;
-    // TODO: class_only impl may not be correct
     PyObject* objtype = _t(obj);
     // handle super() proxy
     if(is_type(obj, tp_super)){