Age | Commit message (Collapse) | Author |
|
> #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.
|
|
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.
|
|
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.
|
|
not what I wanted to commit.
|
|
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.
|
|
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.
|
|
|
|
|