p4analyzer icon indicating copy to clipboard operation
p4analyzer copied to clipboard

Support both quotation styles on `'#include'`

Open timjroberts opened this issue 1 year ago • 0 comments

Currently the preprocessor only considers relative paths, and it also doesn't consider the quotation style. As such, an include in the form '#include "core.p4"' will be resolved relative to the file that contains it. This is correct behavior. Future work is required to support the angle bracket quotation style, and in turn, support for multiple paths while resolving. As outlined in the P4_16 specification, the quotation style simply determines the order in which the preprocessor will need to consider these file paths: '"..."' using the relative path ahead of any additional include path list, and '<...>' using the relative path last.

timjroberts avatar May 10 '23 09:05 timjroberts