issue-#36 support for long identifiers in StdInterpreter

Merged to the master branch

issue-#36 support for long identifiers in StdInterpreter

Postby Josef Templ » Fri Apr 03, 2015 8:24 am

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
User avatar
Josef Templ
 
Posts: 1921
Joined: Tue Sep 17, 2013 6:50 am

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

Postby DGDanforth » Fri Apr 03, 2015 6:31 pm

Seems reasonable.
Is there any conceivable case where longer can get one in trouble?
User avatar
DGDanforth
 
Posts: 1056
Joined: Tue Sep 17, 2013 1:16 am
Location: Palo Alto, California, USA

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

Postby Zinn » Sat Dec 01, 2018 6:04 pm

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
Zinn
 
Posts: 462
Joined: Tue Mar 25, 2014 5:56 pm
Location: Frankfurt am Main

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

Postby Robert » Sun Dec 02, 2018 4:28 pm

User avatar
Robert
 
Posts: 930
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

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

Postby Josef Templ » Tue Dec 04, 2018 6:08 pm

> 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
User avatar
Josef Templ
 
Posts: 1921
Joined: Tue Sep 17, 2013 6:50 am

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

Postby Josef Templ » Wed Dec 05, 2018 6:11 pm

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
User avatar
Josef Templ
 
Posts: 1921
Joined: Tue Sep 17, 2013 6:50 am

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

Postby Robert » Wed Dec 05, 2018 7:47 pm

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.
User avatar
Robert
 
Posts: 930
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

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

Postby Robert » Wed Dec 05, 2018 8:10 pm

I have created topic viewtopic.php?f=40&t=742 for discussion of issue(Bug)#195.
User avatar
Robert
 
Posts: 930
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland


Return to Resolved (Features)

Who is online

Users browsing this forum: No registered users and 2 guests