abc
abc copied to clipboard
Negative external variable initialisers don't work
e.g.
fnord -1;
...produces a syntax error. (Because the CON token only matches positive numbers.)
What I did in my copy was to add a special case in extdef():
https://github.com/davidgiven/ack/commit/8b8910595a4f1652265737a0d8efd931c3e7d201#diff-001711b0da5eb4e0fdb5dd4d0bb2bcfc
Oh, so that's why Alan Snyder's C won't accept a = for initialisation.
int foo1 42;
int foo2 { 42 };
int foo3 = 42;
Error on line 3:
3: SYNTAX ERROR. PARSE SO FAR: <program> <decl_specifiers>
<$declarator> _ = 42 ;
4: SKIPPED: =