• Dridi Boukelmoune's avatar
    vcc: Fold string parsing into a single function · 5a99d056
    Dridi Boukelmoune authored
    Having now the guarantee that VCL sources are always null-terminated we
    can use standard string.h functions to detect long strings. We can also
    generalize vcc_decstr() to work with all kinds of strings.
    
    Instead of duplicating the code in 3 locations with slight variations,
    encode the specificities of each type of string into a struct and have
    one location to parse them.
    
    Bonus deduplication, inline C parsing is identical.
    
    This is loosely inspired by vcl_fixed_token() and we could further
    reduce the size of the loop in vcc_Lexer() by extracting more logic.
    5a99d056
v00019.vtc 1.82 KB