This is a rather simple request from CPC 1.7 rc5.
The module StdInterpreter only supports identifiers up to 31 characters long, which
is not aligned with the CP compiler (255). In some rare situations longer
identifiers are needed as reported by Rainer Neubauer.
A proposal exists in CPC 1.7 rc5 but some changes seem to be needed.
1. The proposal uses ARRAY 64 OF CHAR. The correct solution would be to use
Kernel.Name, because this is what the CP compiler really uses and thereby
ALL valid CP identifiers are supported.
2. For scanning numbers there is no need to change the limit from 32 to 64
or something else. Numbers are not related with identifiers.
So I left this limit unchanged until somebody brings up a case where larger numbers are needed.
Please have a look at the changes in http://redmine.blackboxframework.org/pr ... 6c0b6dd519.
- Josef
issue-#36 support for long identifiers in StdInterpreter
- Josef Templ
- Posts: 2047
- Joined: Tue Sep 17, 2013 6:50 am
- DGDanforth
- Posts: 1061
- Joined: Tue Sep 17, 2013 1:16 am
- Location: Palo Alto, California, USA
- Contact:
Re: issue-#36 support for long identifiers in StdInterpreter
Seems reasonable.
Is there any conceivable case where longer can get one in trouble?
Is there any conceivable case where longer can get one in trouble?
Re: issue-#36 support for long identifiers in StdInterpreter
The support for long identifiers in StdInterpreter is incomplete.
We forgot to change the variable length in the procedure GetTrapMsg of module DevDebug & module StdDebug.
We should change
PROCEDURE GetTrapMsg(OUT msg: ARRAY OF CHAR);
VAR ...
head, tail, errstr: ARRAY 32 OF CHAR;
key: ARRAY 128 OF CHAR;
to
PROCEDURE GetTrapMsg(OUT msg: ARRAY OF CHAR);
VAR ...
head, tail, errstr: ARRAY 128 OF CHAR;
key: ARRAY 512 OF CHAR;
- Helmut
We forgot to change the variable length in the procedure GetTrapMsg of module DevDebug & module StdDebug.
We should change
PROCEDURE GetTrapMsg(OUT msg: ARRAY OF CHAR);
VAR ...
head, tail, errstr: ARRAY 32 OF CHAR;
key: ARRAY 128 OF CHAR;
to
PROCEDURE GetTrapMsg(OUT msg: ARRAY OF CHAR);
VAR ...
head, tail, errstr: ARRAY 128 OF CHAR;
key: ARRAY 512 OF CHAR;
- Helmut
Re: issue-#36 support for long identifiers in StdInterpreter
The link to this issue is: https://redmine.blackboxframework.org/issues/36
- Josef Templ
- Posts: 2047
- Joined: Tue Sep 17, 2013 6:50 am
Re: issue-#36 support for long identifiers in StdInterpreter
> head, tail, errstr: ARRAY 128 OF CHAR;
> key: ARRAY 512 OF CHAR;
for head, tail, and key the worst case is even worse, isn't it?
But it is hard to imagine that somebody uses such long names except
for testing the limits of the run-time system.
On the other side, errstr can be made smaller, I think.
- Josef
> key: ARRAY 512 OF CHAR;
for head, tail, and key the worst case is even worse, isn't it?
But it is hard to imagine that somebody uses such long names except
for testing the limits of the run-time system.
On the other side, errstr can be made smaller, I think.
- Josef
- Josef Templ
- Posts: 2047
- Joined: Tue Sep 17, 2013 6:50 am
Re: issue-#36 support for long identifiers in StdInterpreter
For a possible fix see diffs at https://redmine.blackboxframework.org/p ... 31db1326a6.
I have tried to care for the worst case of variable 'key', but it is really bad.
About 1.5 KB needed on the stack. In exchange for that, I have removed variable modName,
but it is still a very large stack frame and not very pleasing.
Just by accident I have seen some small deviations between StdDebug and DevDebug that I have also tried to remove.
- Josef
I have tried to care for the worst case of variable 'key', but it is really bad.
About 1.5 KB needed on the stack. In exchange for that, I have removed variable modName,
but it is still a very large stack frame and not very pleasing.
Just by accident I have seen some small deviations between StdDebug and DevDebug that I have also tried to remove.
- Josef
Re: issue-#36 support for long identifiers in StdInterpreter
Well, I'm confused for one. The diff above does not seem to mention either issue #36 or StdInterpreter.
Also, and this is probably the explanation, the "Forum topic" link in Redmine bug #195 is broken.
Also, and this is probably the explanation, the "Forum topic" link in Redmine bug #195 is broken.
Re: issue-#36 support for long identifiers in StdInterpreter
I have created topic viewtopic.php?f=40&t=742 for discussion of issue(Bug)#195.