summaryrefslogtreecommitdiff
path: root/sys/src/cmd/cpp/macro.c
AgeCommit message (Collapse)Author
2022-11-04cpp: stringified macros shouldn't split words separate by a dotSigrid Solveig Haflínudóttir
> #define A(s) #s > #define B(s) A(s) > > #define x0 blah blah blah > B(x0) > > #define x1 blah.blah > B(x1) Before the fix, B(x1) would become "blah . blah". After the fix it's "blah.blah", as expected. In fact, the fix has always been there, but commented out on the initial import of The Artwork.
2020-07-13cpp: fix mutually recursive macrosOri Bernstein
Handle cases where parameterless macros expand to each other: #define FOO BAR #define BAR FOO FOO There were cases where the macros didn't make it into the hidesets, and we would recurse infinitely. This fixes that.
2020-04-26copy all the tokens from the tokenrows with a paste.Ori Bernstein
if we do 'CAT(foo bar, baz quux)', the resulting token row should have 3 tokens: 'foo', 'barbaz', 'quux'. tested by jonasa, rebuilding /sys/src, perl, netsurf, and nuklear.
2020-04-25Backed out changeset 2737b9af622bOri Bernstein
not what I wanted to commit.
2020-04-25fix typos in time calculationOri Bernstein
the results of the time calculation were garbled -- and apparently negative on my system when testing, so the test passed when it shouldn't have.
2020-03-17Improve the posix preprocessor.Ori Bernstein
This fixes token pasting, making it expand when it should expand, and paste before expansion when it should paste before expanding. #define CAT(a, b) a ## b #define BAR 3 #define FOO CAT(BAR, 3) FOO now produces 33, while #define CAT(a, b) a ## b #define EOF (-1) #define NOP(x) x NOP(CAT(foo, EOF)) CAT(,EOF) CAT(,) produces fooEOF (-1) <empty> respectively.
2011-03-30Import sources from 2011-03-30 iso image - libTaru Karttunen
2011-03-30Import sources from 2011-03-30 iso imageTaru Karttunen