• Dridi Boukelmoune's avatar
    Align symbol table columns in the generated C code · 77d5d0f0
    Dridi Boukelmoune authored
    At the end of the VGC we output the contents of the symbol table inside
    a C comment. It might look like this:
    
        /*
         * Symbol Table
         *
         * reserved  VOID       41 41 acl
         * reserved  VOID       41 41 backend
         * action    VOID       40 41 ban
         * var       HTTP        0 99 bereq
         * var       BACKEND     0 99 bereq.backend
         * [...]
         */
    
    All columns are currently aligned because we know all the native VCL
    types and only the last column with the symbol names has unpredictable
    and arbitrary entries lengths.
    
    However, considering the following snippet:
    
        new fb = directors.fallback();
    
    The involved symbols will look like:
    
        object    VOID      41 41 directors.fallback
        instance  INSTANCE  41 41 fb
        func      VOID      40 41 fb.add_backend
        func      BACKEND   40 41 fb.backend
        func      VOID      40 41 fb.remove_backend
    
    In the future VMOD objects will likely grow their own types and for the
    same snippet we may have this instead:
    
        object    directors.fallback  41 41 directors.fallback
        method    VOID                40 41 directors.fallback.add_backend
        method    BACKEND             40 41 directors.fallback.backend
        method    VOID                40 41 directors.fallback.remove_backend
        instance  directors.fallback  41 41 fb
    
    This change was initially submitted as part of #3147, but was considered
    trivial and fast-track-able by PHK.
    77d5d0f0
Name
Last commit
Last update
.circleci Loading commit data...
.github Loading commit data...
bin Loading commit data...
doc Loading commit data...
etc Loading commit data...
include Loading commit data...
lib Loading commit data...
m4 Loading commit data...
man Loading commit data...
tools Loading commit data...
.dir-locals.el Loading commit data...
.envrc Loading commit data...
.gitignore Loading commit data...
.lgtm.yml Loading commit data...
.syntastic_c_config Loading commit data...
.travis.yml Loading commit data...
CONTRIBUTING Loading commit data...
ChangeLog Loading commit data...
INSTALL Loading commit data...
LICENSE Loading commit data...
Makefile.am Loading commit data...
README.Packaging Loading commit data...
README.rst Loading commit data...
autogen.des Loading commit data...
autogen.sh Loading commit data...
configure.ac Loading commit data...
flint.lnt Loading commit data...
varnish-legacy.m4 Loading commit data...
varnish.m4 Loading commit data...
varnishapi-uninstalled.pc.in Loading commit data...
varnishapi.pc.in Loading commit data...