Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

The order of preprocessor stringifying is wrong. #513

Open
hdamron17 opened this issue Aug 17, 2020 · 1 comment
Open

The order of preprocessor stringifying is wrong. #513

hdamron17 opened this issue Aug 17, 2020 · 1 comment
Labels
bug Something isn't working preprocessor Issue in the preprocessor (probably cycle detection)

Comments

@hdamron17
Copy link
Collaborator

Stringify should be applied before doing replacement on the function parameters, but that replacement should occur before passing them to deeper functions (I think). I expect this has been broken since #456 but I will dig deeper.

Sample Code

#define str(a) # a
#define xstr(a) str(a)
#define f(x) [x]

str(f(5))
xstr(f(5))

Expected Behavior

"f(5)"
"[5]"

Actual Behavior

"f(5)"
"f(5)"
@hdamron17 hdamron17 added bug Something isn't working preprocessor Issue in the preprocessor (probably cycle detection) labels Aug 17, 2020
hdamron17 added a commit to hdamron17/saltwater that referenced this issue Aug 17, 2020
Add active flag to HashHash so it does not get replaced indefinitely

Ignore test which relies on jyn514#513 - stringify out of order
@hdamron17
Copy link
Collaborator Author

Confirmed: this originated in #456 (specifically commit 3d2d038 but it didn't compile from 34e5ad2..8ef29cf and stringify was not implemented in ..0ef39e4).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working preprocessor Issue in the preprocessor (probably cycle detection)
Projects
None yet
Development

No branches or pull requests

1 participant