lark-parser / lark

Lark is a parsing toolkit for Python, built with a focus on ergonomics, performance and modularity.
MIT License
4.62k stars 395 forks source link

Enhancement of List Concatenation and Iterator Check #1393

Open Akshat111111 opened 4 months ago

Akshat111111 commented 4 months ago

1)Effective List Concatenation: extend() was used in place of list concatenation (+) to improve efficiency. 2)Simplified Iterator Check: Rather than using a bespoke method, the all() function was used to confirm that the iterator was empty. 3)Improved Conditions: Replaced function calls with direct tests for alphanumeric characters and combined conditions directly for readability. 4)Improved yield from: Made the yield from statement simpler for recursive calls, which made the code easier to read and understand.

Akshat111111 commented 4 months ago

I am sorry, what is your goal with this PR? Many of the changes are either

  • breaking potential usecases
  • unnecessary
  • or harder to read.

While I appreciate attempts to contribute to open source, it would be preferably if you didn't make random changes but instead tried to fix a few existing issues.

Sure, I will focus on existing issues.I wanted to make the function more clear but now realized that Its not working for some use cases