Page MenuHomePhabricator

Feat: Added the ability to close off string or nested string, if " or \' was forgot to be added. Fixed some bugs as well.
ClosedPublic

Authored by jdtolmie on Oct 20 2022, 6:31 PM.

Details

Test Plan

Find a way to make sure the strings are closed off in case someone forgets to add a closing '\ or \".

Diff Detail

Repository
rI IOSqueak
Lint
Lint Not Applicable

Event Timeline

Restricted Application completed remote builds in Restricted Buildable.Oct 20 2022, 6:31 PM
Restricted Application completed remote builds in Restricted Buildable.Oct 20 2022, 6:34 PM
  • Removed cout showing the values of various bools for checking for open/closed option strings.
Restricted Application completed remote builds in Restricted Buildable.Oct 20 2022, 6:45 PM
  • Feat: Fixed the help menu to display the description nicely. It now prints the command on the left, and word wraps the description.
Restricted Application completed remote builds in Restricted Buildable.Oct 24 2022, 5:05 PM
iosqueak-source/src/blueshell/backspace.cpp
22

This line is repeated at least 4 times, why not use something like this and make function calls instead?

bool function (bool argument) {
  return ((argument) ? false: true);
}

@wdede
I have a question about what you think is best. I added it to the comment you made.

iosqueak-source/src/blueshell/backspace.cpp
22

Did you think it is better to have the function take a reference and change it there, or return the value only?
void func(bool& argument){argument = (argument)?false : true;}
Called using function(inner_quote); //automatically change the value.
as opposed to
bool func(bool argument){ return (argument)?false : true;
Called using inner_quote = function(inner_quote);

If the last one, would that not make changing my code of
inner_quote = (inner_quote) ? false : true; to
inner_quote = function(inner_quote);
roughly the same repeated code, but now requires a function to be called?

I will trust @wdede to approve this at his discretion. :)

  • Perf: Removed std::map<std::string, std::pair<std::pair<std::pair<std::string, std::string>, _register>, int>> as it was confusing trying to figure out how to access it (is it second.second.first, or second.second.second?). Replaced with struct, and made a map<string, struct_name>. Changed the other files to work with the new struct.
  • Added file to register the default commands for the shell.
Restricted Application completed remote builds in Restricted Buildable.Oct 25 2022, 6:46 PM
Restricted Application completed remote builds in Restricted Buildable.Oct 25 2022, 6:51 PM
  • Style: Removed old code commented out after change to map<string, cmd_map>.
Restricted Application completed remote builds in Restricted Buildable.Oct 25 2022, 6:55 PM
  • Perf: Added cmd_map struct to seperate header, as the cppcheck linter was complaining about some un-used variable, even though it was used.
Restricted Application completed remote builds in Restricted Buildable.Oct 26 2022, 4:02 PM
Restricted Application completed remote builds in Restricted Buildable.Oct 26 2022, 4:07 PM
  • Perf: Trying to fix linter issue of unused variable, even though it is used.
Restricted Application completed remote builds in Restricted Buildable.Oct 26 2022, 4:33 PM
Restricted Application completed remote builds in Restricted Buildable.Oct 26 2022, 4:56 PM
  • Feat: Added the ability to use double tab at the end of the string, and not only the first word. Added a few other features.
Restricted Application completed remote builds in Restricted Buildable.Oct 28 2022, 5:25 PM
  • Trying to fix linter error.
Restricted Application completed remote builds in Restricted Buildable.Oct 28 2022, 6:11 PM
This comment was removed by jdtolmie.
Restricted Application completed remote builds in Restricted Buildable.Oct 28 2022, 6:15 PM
This comment was removed by jdtolmie.
Restricted Application completed remote builds in Restricted Buildable.Oct 28 2022, 6:16 PM

@wdede
I have a question about what you think is best. I added it to the comment you made.

The function would be written once and called as many times as needed. Basically, it is not really a repetition as the argument will be different every time.
Second, in my opinion, here there is no "need" to pass by reference, you can just pass the objects by value, I avoid messing with pointers and referenced values when not necessary. But feel free to experiment.

In D545#17695, @wdede wrote:

@wdede
I have a question about what you think is best. I added it to the comment you made.

The function would be written once and called as many times as needed. Basically, it is not really a repetition as the argument will be different every time.
Second, in my opinion, here there is no "need" to pass by reference, you can just pass the objects by value, I avoid messing with pointers and referenced values when not necessary. But feel free to experiment.

I found out I could just do a outer_single = !outer_single to swap it. I will just do that. No need for excess code and a function for that.

This revision is now accepted and ready to land.Nov 3 2022, 5:34 PM
  • Feat: Finished cmd_map header to replace map<pair<pair>>. Added the ability to use 'history' with a command search (eg. history test_attempt' would list only any history with test_attempt, and no others.
This revision now requires review to proceed.Nov 4 2022, 6:10 PM
Restricted Application completed remote builds in Restricted Buildable.Nov 4 2022, 6:10 PM
  • Style: Changed for loop to transform because linter suggested it. Made various changes to the code to clean things up. Fixed issue with 'help <command name>' printing the container out in the wrong order.
Restricted Application completed remote builds in Restricted Buildable.Nov 6 2022, 12:22 PM
  • Style: Just removed some old comments that I missed.
Restricted Application completed remote builds in Restricted Buildable.Nov 6 2022, 1:06 PM
  • Docs: Updated the blueshell.rst file for usage on Blueshell.
Restricted Application completed remote builds in Restricted Buildable.Nov 6 2022, 5:15 PM
  • Feat: Added 'list' function to list all the registered functions available.
Restricted Application completed remote builds in Restricted Buildable.Nov 7 2022, 1:37 PM
  • Feat: Added the list command to list registered commands.
Restricted Application completed remote builds in Restricted Buildable.Nov 7 2022, 3:37 PM
This revision is now accepted and ready to land.Nov 9 2022, 6:45 AM