If a commander (DevCommanders.View) executes a command it does not show an error
message when the text following the commander is neither a quoted string nor a
qualified identifier.
This appears in particular when a double-quoted string is used for executing a
sequence of commands and the string is longer than 256 characters.
The limit of 256 characters should be lifted and an error message should be displayed
if a command is not well-formed.
I have prepared and tested the required changes.For the diff see http://redmine.blackboxframework.org/pr ... a399ccfe4e.
- Josef
issue-#118 commander does not show error message
- Josef Templ
- Posts: 2047
- Joined: Tue Sep 17, 2013 6:50 am
Re: issue-#118 commander does not show error message
Code: Select all
PROCEDURE ScanLongString(R: TextModels.Reader; VAR cmd: POINTER TO ARRAY OF CHAR; VAR beg: INTEGER);
- Josef Templ
- Posts: 2047
- Joined: Tue Sep 17, 2013 6:50 am
Re: issue-#118 commander does not show error message
It is a widespread convention in the BlackBox sources to use
F for a file, V for a view, W for a writer and R for a reader.
I simply followed that convention and I would prefer not to change that now.
- Josef
F for a file, V for a view, W for a writer and R for a reader.
I simply followed that convention and I would prefer not to change that now.
- Josef
-
- Posts: 1700
- Joined: Tue Sep 17, 2013 12:21 am
- Location: Russia
Re: issue-#118 commander does not show error message
In BlackBox rd is used in most places. I agree with Robert, that we should follow general convention and start all variables with small letters.
- Josef Templ
- Posts: 2047
- Joined: Tue Sep 17, 2013 6:50 am
Re: issue-#118 commander does not show error message
of course you are right.
I mixed it up with the conventions in the original Oberon system,
which I happened to get in touch with recently.
R changed to r as in GetParExtend.
The diffs are here:
http://redmine.blackboxframework.org/pr ... a399ccfe4e.
- Josef
I mixed it up with the conventions in the original Oberon system,
which I happened to get in touch with recently.
R changed to r as in GetParExtend.
The diffs are here:
http://redmine.blackboxframework.org/pr ... a399ccfe4e.
- Josef
- Josef Templ
- Posts: 2047
- Joined: Tue Sep 17, 2013 6:50 am
Re: issue-#118 commander does not show error message
Please review the changes.
From my point of view this is ready for voting.
R has been renamed to r as suggested by Robert.
FYI: this issue fixes a nasty bug in command interpretation of commanders.
It took me hours to figure out what went wrong.
As long as the total length of a command is below 256 it worked fine.
When I added one more procedure call, so that the total length is > 256,
it did nothing. Not even an error message. So I didn't know what was going on.
Technically, there is no reason for a length limitation here. It's only because of
an inappropriate usage of a text scanner for the total command sequence.
The scanner must only be used for parts of a command.
The issue fixes both problems.
1. it avoids the length limit of 256
2. it outputs an error message if the command syntax is wrong, e.g.
because it starts with an invalid symbol.
- Josef
From my point of view this is ready for voting.
R has been renamed to r as suggested by Robert.
FYI: this issue fixes a nasty bug in command interpretation of commanders.
It took me hours to figure out what went wrong.
As long as the total length of a command is below 256 it worked fine.
When I added one more procedure call, so that the total length is > 256,
it did nothing. Not even an error message. So I didn't know what was going on.
Technically, there is no reason for a length limitation here. It's only because of
an inappropriate usage of a text scanner for the total command sequence.
The scanner must only be used for parts of a command.
The issue fixes both problems.
1. it avoids the length limit of 256
2. it outputs an error message if the command syntax is wrong, e.g.
because it starts with an invalid symbol.
- Josef
- DGDanforth
- Posts: 1061
- Joined: Tue Sep 17, 2013 1:16 am
- Location: Palo Alto, California, USA
- Contact:
Re: issue-#118 commander does not show error message
Small unimportant comment.
I prefer "rd" for a reader and "wr" for a writer.
I prefer "rd" for a reader and "wr" for a writer.
- Josef Templ
- Posts: 2047
- Joined: Tue Sep 17, 2013 6:50 am
Re: issue-#118 commander does not show error message
r renamed to rd.
I also noticed that the parameter 'beg' of ScanLongString is not used anymore so I removed it.
For the latest diff see: http://redmine.blackboxframework.org/pr ... 7da1bc976f.
- Josef
I also noticed that the parameter 'beg' of ScanLongString is not used anymore so I removed it.
For the latest diff see: http://redmine.blackboxframework.org/pr ... 7da1bc976f.
- Josef