akshansh's Blog

Week 7 - Progress Report

akshansh
Published: 07/30/2022

Tasks Accomplished This Week

Issues Closed/Partially Completed

  1. [New] Nested Call is not recognized · Issue #791 · lcompilers/lpython (github.com) [CLOSED]
  2. [Parser] Add `type-comment` support in new parser by akshanshbhatt · Pull Request #801 · lcompilers/lpython (github.com) [CLOSED]
  3. [New] Parse `/` and `*` as a parameter in function definition · Issue #513 · lcompilers/lpython (github.com) [OPEN]
  4. [Parser] Issues with `BoolOp` node generation in new parser · Issue #777 · lcompilers/lpython (github.com) [CLOSED]
  5. [Parser] List Indexing is not supported in the new parser · Issue #778 · lcompilers/lpython (github.com) [CLOSED]
  6. [Parser] Tuples are not parsed in the `for-loop` (new parser) · Issue #779 · lcompilers/lpython (github.com) [CLOSED]
  7. [Parser] Error in parsing function definition (new parser) · Issue #803 · lcompilers/lpython (github.com) [CLOSED]

PRs

  1. [Parser] Add support for parsing nested function calls by akshanshbhatt · Pull Request #830 · lcompilers/lpython (github.com) [CLOSED]
  2. [Parser] Parse `type_comment` in function args by akshanshbhatt · Pull Request #845 · lcompilers/lpython (github.com) [CLOSED]
  3. [Parser] Add support for parsing strings with all possible `stringprefix` by akshanshbhatt · Pull Request #847 · lcompilers/lpython (github.com) [CLOSED]
  4. [Parser] Revert `BoolOp` node generation in the new parser by akshanshbhatt · Pull Request #848 · lcompilers/lpython (github.com) [CLOSED]
  5. [WIP][Parser] Properly handle functions with `*` and `/` in the new parser by akshanshbhatt · Pull Request #850 · lcompilers/lpython (github.com) [OPEN]
View Blog Post

Week 6 - Progress Report

akshansh
Published: 07/22/2022

Tasks Accomplished This Week

Issues Raised

  1. [Parser] Expressions containing `in` are not parsed properly (new parser) · Issue #780 · lcompilers/lpython (github.com) [CLOSED]
  2. [Parser] Issues with `BoolOp` node generation in new parser · Issue #777 · lcompilers/lpython (github.com) [OPEN]
  3. [Parser] List Indexing is not supported in the new parser · Issue #778 · lcompilers/lpython (github.com) [OPEN]
  4. [Parser] Tuples are not parsed in the `for-loop` (new parser) · Issue #779 · lcompilers/lpython (github.com) [OPEN]
  5. [Parser] Error in parsing function definition (new parser) · Issue #803 · lcompilers/lpython (github.com) [OPEN]

Issues Closed/Partially Completed

  1. [Parser] Error in parsing function definition (new parser) · Issue #803 · lcompilers/lpython (github.com) [OPEN]
  2. [Parser] Tuples are not parsed in the `for-loop` (new parser) · Issue #779 · lcompilers/lpython (github.com) [OPEN]
  3. [New] Default value (Argument assignment) is not recognized in Class statement · Issue #787 · lcompilers/lpython (github.com) [OPEN]

PRs

  1. [Parser] Add `type-comment` support in new parser by akshanshbhatt · Pull Request #801 · lcompilers/lpython (github.com) [CLOSED]
  2. [Parser] Fix issue 803 by akshanshbhatt · Pull Request #808 · lcompilers/lpython (github.com) [OPEN]
  3. [Parser] Add support for parsing tuples in `for-loop` by akshanshbhatt · Pull Request #809 · lcompilers/lpython (github.com) [OPEN]
  4. [Parser] Recognise default values (keywords) in `class-def` by akshanshbhatt · Pull Request #810 · lcompilers/lpython (github.com) [OPEN]
View Blog Post

Week 5 - Progress Report

akshansh
Published: 07/16/2022

Tasks Accomplished This Week

Issues Closed/Partially Completed

  1. [New] Parse raw, byte and formatted strings · Issue #512 · lcompilers/lpython (github.com) [CLOSED]
  2. TODO: Extract type hints from the comments · Issue #485 · lcompilers/lpython (github.com) [CLOSED]

Merged PRs

  1. [Parser] Parse raw strings by akshanshbhatt · Pull Request #734 · lcompilers/lpython (github.com) [CLOSED]
  2. [Parser] Parse indexing operations on attributes by akshanshbhatt · Pull Request #751 · lcompilers/lpython (github.com) [CLOSED]
  3. [Parser] Parse `type-comments` in `for-loops` by akshanshbhatt · Pull Request #724 · lcompilers/lpython (github.com) [CLOSED]

Problems Faced This Week

<meta charset="utf-8">

  • While working on making the BoolOp node have multiple values of expr type, I faced numerous issues. I could not make it match the output from the current parser. Thirumalai and I collaboratively worked on it and overcame most of the problems. It is mostly complete and requires some minor changes before submitting the final patch.

Plans For Upcoming Week

<meta charset="utf-8">

  • The new parser still generates many errors I found while testing on Python files from NumPy and SymPy repos. I will open issues related to each of these errors and fix them. One good sign I noticed was that whatever AST the new parser generates (after commenting out the error causing part) is highly accurate compared to the existing one.
View Blog Post

Week 4 - Progress Report

akshansh
Published: 07/09/2022

Tasks Accomplished This Week

Issues Raised

  1. [Parser] `Tokenizer Error` on list comprehension example · Issue #752 · lcompilers/lpython (github.com) [OPEN]

Issues Closed/Partially Completed

  1. [New] Parse raw, byte and formatted strings · Issue #512 · lcompilers/lpython (github.com) [OPEN]
  2. TODO: Extract type hints from the comments · Issue #485 · lcompilers/lpython (github.com) [OPEN]

PRs

  1. [Parser] Parse raw strings by akshanshbhatt · Pull Request #734 · lcompilers/lpython (github.com) [OPEN]
  2. [Parser] Parse indexing operations on attributes by akshanshbhatt · Pull Request #751 · lcompilers/lpython (github.com) [OPEN]
  3. [Parser] Parse `type-comments` in `for-loops` by akshanshbhatt · Pull Request #724 · lcompilers/lpython (github.com) [OPEN]

Problems Faced This Week

  • I didn't face any major problems this week.

Plans For Upcoming Week

  • Most of the major AST nodes are implemented now. I plan to rigorously test the new parser to its limit by parsing python files from some of the major Python projects' repos such as SymPy and NumPy.
  • Comparing the AST generated by the new parser from that of the existing parser would let us know the changes to be made in the current parser generator file.
View Blog Post

Week 3 - Progress Report

akshansh
Published: 07/02/2022

View Blog Post