Page 1 of 1

issue-#36 support for long identifiers in StdInterpreter

PostPosted: Fri Apr 03, 2015 8:24 am
by Josef Templ
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/projects/blackbox/repository/revisions/1e19c3f68052712af0e3a4759e46db6c0b6dd519.

- Josef

Re: issue-#36 support for long identifiers in StdInterpreter

PostPosted: Fri Apr 03, 2015 6:31 pm
by DGDanforth
Seems reasonable.
Is there any conceivable case where longer can get one in trouble?

Re: issue-#36 support for long identifiers in StdInterpreter

PostPosted: Sat Dec 01, 2018 6:04 pm
by Zinn
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

Re: issue-#36 support for long identifiers in StdInterpreter

PostPosted: Sun Dec 02, 2018 4:28 pm
by Robert

Re: issue-#36 support for long identifiers in StdInterpreter

PostPosted: Tue Dec 04, 2018 6:08 pm
by Josef Templ
> 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

Re: issue-#36 support for long identifiers in StdInterpreter

PostPosted: Wed Dec 05, 2018 6:11 pm
by Josef Templ
For a possible fix see diffs at https://redmine.blackboxframework.org/projects/blackbox/repository/diff?utf8=%E2%9C%93&rev=f73ce39774a007fb1276dd938f74e2c1a4c7adf6&rev_to=7a3629245ce2a0d6b77f4e2c94b3ba31db1326a6.

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

PostPosted: Wed Dec 05, 2018 7:47 pm
by Robert
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.

Re: issue-#36 support for long identifiers in StdInterpreter

PostPosted: Wed Dec 05, 2018 8:10 pm
by Robert
I have created topic viewtopic.php?f=40&t=742 for discussion of issue(Bug)#195.