Giter Club home page Giter Club logo

Comments (13)

iipeace avatar iipeace commented on June 2, 2024

It looks better! πŸ‘

from guider.

elfring avatar elfring commented on June 2, 2024

I propose to reconsider and improve also special string concatenations which can be found with the help of a search pattern like the following.

[Markus_Elfring@fedora guider]$ grep --perl-regexp --count "(\w+)\s*=\s*('|\")%s.*%s.*\2\s*%\s*\(\1,.+\)" guider.py
113

Example:

                         if SysMgr.lineLength > nowLen + len(nextCall):
-                            userCall = '%s%s' % (userCall, nextCall)
+                            userCall += nextCall
                             nowLen += len(nextCall)

Would you like to adjust any more questionable data processing details? πŸ€”

from guider.

iipeace avatar iipeace commented on June 2, 2024

I agree with you!
I'll fix them!

from guider.

elfring avatar elfring commented on June 2, 2024

Would you like to use any development tools which can help a bit more to perform mass source code transformations? πŸ€”

from guider.

iipeace avatar iipeace commented on June 2, 2024

Yes, I would like to use those tools if I can use them.
Could you recommend any tools?

from guider.

elfring avatar elfring commented on June 2, 2024
  • Something can be achieved by the application of advanced regular expressions to some degree.
  • Do you know any development tools which can take regex captures better into account?
  • How do you think about to extend possibilities for collateral evolution by means of variations with computation tree logic?

from guider.

elfring avatar elfring commented on June 2, 2024

Thanks for another source code improvement.

I guess that there are more remaining update candidates to consider according to the discussed transformation pattern.

Additional change suggestion:

                         else:
-                            userCall = '%s\n%s %s' % \
-                                (userCall, ' ' * indentLen, nextCall)
+                            userCall += '\n%s %s' % (' ' * indentLen, nextCall)
                             nowLen = indentLen + len(nextCall)

Would you find development tools (like the following) helpful?

from guider.

elfring avatar elfring commented on June 2, 2024

Yes, I would like to use those tools if I can use them.

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

[Markus_Elfring@fedora lokal]$ ./comby -diff ':[[a]] = :[a] + :[[b]]' ':[a] += :[b]' $(find /home/altes_Heim2/elfring/Projekte/guider/lokal -name '*.py')

from guider.

iipeace avatar iipeace commented on June 2, 2024

I checked this result :)
some lines are wrong but other is useful :)

+++ guider.py
@@ -20727,12 +20727,12 @@
                     data2 = ord(source[count])

                 thisVal = data1*256 + data2
-                sum = sum + thisVal
+                sum += thisVal
                 sum = sum & 0xffffffff # Necessary?
-                count = count + 2
+                count += 2

             if countTo < len(source):
-                sum = sum + ord(source[len(source) - 1])
+                sum += ord(source[len(source) - 1])
                 sum = sum & 0xffffffff # Necessary?

             sum = (sum >> 16)  +  (sum & 0xffff)
@@ -62803,7 +62803,7 @@
                 if sym.endswith(Debugger.RETSTR):
                     rsym = sym
                 else:
-                    rsym = sym + Debugger.RETSTR
+                    rsym += Debugger.RETSTR

                 # add return stats #
                 if rsym in instance.callTable and \
@@ -67605,7 +67605,7 @@
                         struct.unpack('HHHHIII', target)

                     # get verdef strings #
-                    soffset = offset + vd_aux
+                    soffset += vd_aux
                     for vidx in range(vd_cnt):
                         starget = verdef_section[soffset:soffset+sentsize]
                         vda_name, vda_next = \
@@ -67643,7 +67643,7 @@
                         struct.unpack('HHIII', target)

                     # get verneed strings #
-                    soffset = offset + entsize
+                    soffset += entsize
                     for vidx in range(vn_cnt):
                         starget = verneed_section[soffset:soffset+entsize]
                         vna_hash, vna_flags, vna_other, vna_name, vna_next = \

from guider.

elfring avatar elfring commented on June 2, 2024

some lines are wrong but other is useful

πŸ’­ Would you like to integrate anything from a source code transformation result which can be generated also by a command like the following?
(πŸ‘‰ Update candidates in 26 lines)

[Markus_Elfring@fedora lokal]$ perl -p -i.orig -0777 -e 's/^(?<indentation>\s+)(?<target>\S+)\s*=\s*\k<target>\s*(?<operator>[+\-%&|^@]|\*\*?|\/\/?|<<|>>)/$+{indentation}$+{target} $+{operator}=/gm' $(find /home/altes_Heim2/elfring/Projekte/guider/lokal -name '*.py')

from guider.

elfring avatar elfring commented on June 2, 2024

How do you think about to share insights for the evolution of run time characteristics (eventually also for a software component like β€œSly Lex Yacc”) together with adjustments for discussed implementation details? πŸ€”

from guider.

elfring avatar elfring commented on June 2, 2024

πŸ’­ Do any factors hinder the wider application of functionality which became generally available with Python 2?

from guider.

iipeace avatar iipeace commented on June 2, 2024

I also like the augmented assignment expression :)
I already applied it in manual and using your scripts.

from guider.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.