Why does Parser.Pike accept a bunch of backquote identifiers that don't correspond to any lfuns and that pike itself doesn't accept?
The reason I found this is because post_modules/_ADT/sequence.cmod tries to define an lfun `-=. That's currently meaningless since it will never be called, but perhaps the intention is to prepare for a future extension.
Anyway, it means that 7.5 currently can't use a 7.4 Pike for precompilation, which I think should be possible. Maybe the stuff in precompile.sh.in that made older pikes use the latest parser modules should be resurrected.
Ahh sorry, I thought there was a need for one since there is a -= lfun, but I guess it call +=(-arg) instead?
/ Peta, jo det är jag
Previous text:
2003-04-04 20:18: Subject: `-=
Why does Parser.Pike accept a bunch of backquote identifiers that don't correspond to any lfuns and that pike itself doesn't accept?
The reason I found this is because post_modules/_ADT/sequence.cmod tries to define an lfun `-=. That's currently meaningless since it will never be called, but perhaps the intention is to prepare for a future extension.
Anyway, it means that 7.5 currently can't use a 7.4 Pike for precompilation, which I think should be possible. Maybe the stuff in precompile.sh.in that made older pikes use the latest parser modules should be resurrected.
/ Martin Stjernholm, Roxen IS
There is no `-=() lfun as far as I know. Check program.c:lfun_names[] to see for your self.
/ Henrik Grubbström (Lysator)
Previous text:
2003-04-05 16:08: Subject: `-=
Ahh sorry, I thought there was a need for one since there is a -= lfun, but I guess it call +=(-arg) instead?
/ Peta, jo det är jag
Why does Parser.Pike accept a bunch of backquote identifiers that don't correspond to any lfuns and that pike itself doesn't accept?
Because otherwise Parser.Pike produces strange results that are difficult to debug. I don't see it as a problem that Parser.Pike outputs illegal tokens if you feed it with illegal Pike code. The precompiler should probably validate its data more though.
/ Martin Nilsson (har bott i google)
Previous text:
2003-04-04 20:18: Subject: `-=
Why does Parser.Pike accept a bunch of backquote identifiers that don't correspond to any lfuns and that pike itself doesn't accept?
The reason I found this is because post_modules/_ADT/sequence.cmod tries to define an lfun `-=. That's currently meaningless since it will never be called, but perhaps the intention is to prepare for a future extension.
Anyway, it means that 7.5 currently can't use a 7.4 Pike for precompilation, which I think should be possible. Maybe the stuff in precompile.sh.in that made older pikes use the latest parser modules should be resurrected.
/ Martin Stjernholm, Roxen IS
The problem is that the sequence `-= isn't illegal. It consists of the two tokens `- and =. Thus Parser.Pike fails to parse e.g. this perfectly legal declaration correctly:
int `-=7;
/ Martin Stjernholm, Roxen IS
Previous text:
2003-04-05 19:15: Subject: `-=
Why does Parser.Pike accept a bunch of backquote identifiers that don't correspond to any lfuns and that pike itself doesn't accept?
Because otherwise Parser.Pike produces strange results that are difficult to debug. I don't see it as a problem that Parser.Pike outputs illegal tokens if you feed it with illegal Pike code. The precompiler should probably validate its data more though.
/ Martin Nilsson (har bott i google)
That is of course a problem. Does that mean that it is an error in the grammar that
int `+ =7;
works but
int `+=7;
does not?
/ Martin Nilsson (har bott i google)
Previous text:
2003-04-05 19:18: Subject: `-=
The problem is that the sequence `-= isn't illegal. It consists of the two tokens `- and =. Thus Parser.Pike fails to parse e.g. this perfectly legal declaration correctly:
int `-=7;
/ Martin Stjernholm, Roxen IS
No, since the terminal `+= exists in the grammar and the lexer is constructed to always choose the longest possible terminal. So if `-= was added to the grammar then it would be just as wrong to parse the sequence `-= as two tokens.
(This shows that it isn't so easy to extend the set of operator tokens and backquote identifiers. If the new token is a concatenation of shorter tokens then one must make sure that the concatenation isn't grammatically valid anywhere in the language.)
/ Martin Stjernholm, Roxen IS
Previous text:
2003-04-05 19:23: Subject: `-=
That is of course a problem. Does that mean that it is an error in the grammar that
int `+ =7;
works but
int `+=7;
does not?
/ Martin Nilsson (har bott i google)
Anybody using
int `-=7;
in their code deserve having it broken. However, using #pike, it shouldn't be a problem implementing new tokens whenever. Backwards compaibility is king, and #pike is the way to maintain it.
/ Fredrik (Naranek) Hubinette (Real Build Master)
Previous text:
2003-04-05 19:34: Subject: `-=
No, since the terminal `+= exists in the grammar and the lexer is constructed to always choose the longest possible terminal. So if `-= was added to the grammar then it would be just as wrong to parse the sequence `-= as two tokens.
(This shows that it isn't so easy to extend the set of operator tokens and backquote identifiers. If the new token is a concatenation of shorter tokens then one must make sure that the concatenation isn't grammatically valid anywhere in the language.)
/ Martin Stjernholm, Roxen IS
#pike doesn't solve compatibility issues, it only makes it easier to cope with them. In the case of `-= it'd probably not be a significant problem, but I wouldn't like to see e.g. =! as a new token, #pike notwithstanding.
/ Martin Stjernholm, Roxen IS
Previous text:
2003-04-06 03:27: Subject: `-=
Anybody using
int `-=7;
in their code deserve having it broken. However, using #pike, it shouldn't be a problem implementing new tokens whenever. Backwards compaibility is king, and #pike is the way to maintain it.
/ Fredrik (Naranek) Hubinette (Real Build Master)
Making =! a new token would be stupid. No preprocessor statement in the world can cure stupidity I'm afraid.
Generally speaking, it's never a good idea to change something in a backwards-incompatible way, but #pike gives us the tools to do it in a graceful manner when deemed nessesary. I certainly prefer using #pike to the deprecate-remove-cycle that other languages use...
Side note: One of these days I'm going to try to run my old roxen 1.3 with pike 7.4 using -V0.6. Expect bug reports. :)
/ Fredrik (Naranek) Hubinette (Real Build Master)
Previous text:
2003-04-06 15:18: Subject: `-=
#pike doesn't solve compatibility issues, it only makes it easier to cope with them. In the case of `-= it'd probably not be a significant problem, but I wouldn't like to see e.g. =! as a new token, #pike notwithstanding.
/ Martin Stjernholm, Roxen IS
pike-devel@lists.lysator.liu.se