FPGAwars / icestudio

:snowflake: Visual editor for open FPGA boards
https://icestudio.io
GNU General Public License v2.0
1.69k stars 244 forks source link

Increase the usage of compound assignment operators #558

Open elfring opened 2 years ago

elfring commented 2 years ago

:eyes: Some source code analysis tools can help to find opportunities for improving software components. :thought_balloon: I propose to increase the usage of compound operators accordingly.

Would you like to integrate anything from a transformation result which can be generated by a command like the following? (:point_right: Please check also for questionable change suggestions because of an evolving search pattern.)

lokal$ perl -p -i.orig -0777 -e 's#\b(?<target>\S+)\s*=\s*\k<target>[ \t]*(?<operator>[+\-/%^]|\*\*?|&&?|\|\|?|\?\?|<<|>>>?)#$+{target} $+{operator}=#gm' $(find ~/Projekte/icestudio/lokal -name '*.js')

:crystal_ball: How will development interests evolve further also according to update candidates in 40 lines of this software?

TimRudy commented 1 year ago

I guess this refers to the Node.js source code of Icestudio? Anyone who has an improvement for Icestudio is welcome to create a PR, and that's how improvements will happen.

The link refers to grammar of JavaScript, and "&&=" operators - your goal is not very clear, but you should do this yourself and we'll see the result.

I propose closing

elfring commented 1 year ago

… - your goal is not very clear, …

:thought_balloon: Would you dare to perform a source code search and corresponding replacements in another development repository with the help of the shown Perl command example?