Currently, one must call set_token in nmodl.yy to have information about where the token appears in the MOD file. Since, it's manual, it's rarely used, and many nodes of the initial AST don't have any token information associated with them.
Instead of fixing all occurences using the current API, we could consider changing the ctors for AST nodes such that they expect the ModToken (describing the location) as their first argument, and then the additional arguments. This way the compiler will complain about any omissions.
Currently, one must call
set_token
innmodl.yy
to have information about where the token appears in the MOD file. Since, it's manual, it's rarely used, and many nodes of the initial AST don't have any token information associated with them.For example FUNCTION and PROCEDURE blocks have their
ModToken
set, while NET_RECEIVE doesn't. https://github.com/BlueBrain/nmodl/blob/5abff4fb49b8d00b8903e0b745f805f8169ff6c0/src/parser/nmodl.yy#L1496-L1506Instead of fixing all occurences using the current API, we could consider changing the ctors for AST nodes such that they expect the
ModToken
(describing the location) as their first argument, and then the additional arguments. This way the compiler will complain about any omissions.