Closed remexre closed 6 years ago
Virtual locations in Copper (which were put in specifically to support this use case) include only line and column, so the character index you are using is indeed coming from the "real" location in the preprocessed file.
If I recall correctly, this is unavoidable when using location metadata from the C preprocessor, which includes only the filename and line number, not the byte or character index. (Edit: If it is possible to get the necessary information from the C preprocessor, it would be fairly simple to add a character index to the virtual location object to support it.)
Closing this, since it's not possible. (cpp only gives a line number)
I'm trying to get byte indices within a C file after parsing with ableC, using the
Message.index
andMessage.endIndex
attributes; however, it appears that they are relative to the preprocessed source, not the file's source. The line and column numbers are updated inedu/umn/cs/melt/ableC/concretesyntax/cppTags/CPPTags.sv
, in an action block. Is it possible to updateindex
andendIndex
in the same way, or is that not possible/would cause breakage?@ericvanwyk is sitting here and he doesn't know either