Currently, the parser logic uses routine_t = void (*)(const token_t&) which forces compiler to generate functions for every routine even when they can be inlined.
Proposed Solution:
The ideal situation is to create lambda functions (or functors, more generally) for these routines which get passed around. The type routine_t will be defined as std::function<void(const token_t&)>. Most of the existing code can remain.
Currently, the parser logic uses
routine_t = void (*)(const token_t&)which forces compiler to generate functions for every routine even when they can be inlined.Proposed Solution:
The ideal situation is to create lambda functions (or functors, more generally) for these routines which get passed around. The type
routine_twill be defined asstd::function<void(const token_t&)>. Most of the existing code can remain.