• Dridi Boukelmoune's avatar
    Register types and type methods as symbols · a82916ea
    Dridi Boukelmoune authored
    The SYM_METHOD kind of symbol was already present but never used so it
    just found its purpose.
    
    They appear in their dedicated symbol table:
    
        /*
         * Symbol Table MAIN
         *
         * reserved  VOID       41 41 acl
         * reserved  VOID       41 41 backend
         * [...]
         */
    
        /*
         * Symbol Table TYPE
         *
         * none      VOID     40 41 BACKEND
         * method    BACKEND  40 41 BACKEND.resolve
         * none      VOID     40 41 STEVEDORE
         * method    BYTES    40 41 STEVEDORE.free_space
         * method    BOOL     40 41 STEVEDORE.happy
         * method    BYTES    40 41 STEVEDORE.used_space
         * none      VOID     40 41 STRINGS
         * method    STRING   40 41 STRINGS.lower
         * method    STRING   40 41 STRINGS.upper
         */
    
    Unlike VMOD functions or object methods, native type methods are never
    invoked as a standalone statement:
    
        strings.upper();
    
    They are only evaluated atop an expression:
    
        (string expression).upper();
    
    So any VMOD named after a type, like vmod_blob, should not conflict with
    native type methods in the symbol table. Unless a symbol already exists
    in the MAIN namespace, like reserved keywords acl and backend.
    a82916ea
vcc_xref.c 10.9 KB