Skip to content

Refactor: Review project, fix bugs, and improve parser functionality.#1

Open
abdoei wants to merge 1 commit intomainfrom
project-review-fixes
Open

Refactor: Review project, fix bugs, and improve parser functionality.#1
abdoei wants to merge 1 commit intomainfrom
project-review-fixes

Conversation

@abdoei
Copy link
Owner

@abdoei abdoei commented May 22, 2025

I created this while experimenting Google's Jules and I couldn't review it there as there were no changes highlighting.

This commit addresses several issues found during a project review:

  • Corrected a typo in README.md ("Paser" to "Parser").
  • Integrated the Parser into main.cpp, so it now processes input files and can dump the AST.
  • Fixed Lexer::line_start_idx logic for more robust line number tracking, especially for empty files or files without trailing newlines.
  • Refined SourceFile::fill_the_buffer() to use std::filesystem::path consistently.
  • Significantly enhanced parser error reporting:
    • Errors now show file, line, column, the problematic token, and the line of code with a marker.
    • Parser::ReportError method added for centralized error handling.
  • Removed a duplicated line in the "Known limitations" section of README.md.
  • Added a basic parser test (ParserTest.HandlesSimpleFunction):
    • Includes a new sample file test/sample_parser_0.AL.
    • Verifies that a simple function declaration is parsed correctly without errors.
  • Updated CMakeLists.txt to include the new parser test and ensure proper linking.

These changes provide a better understanding of the project's current state, fix several small bugs, and lay a better foundation for future development by improving the parser's utility and test coverage.

This commit addresses several issues found during a project review:

- Corrected a typo in README.md ("Paser" to "Parser").
- Integrated the Parser into `main.cpp`, so it now processes input files and can dump the AST.
- Fixed `Lexer::line_start_idx` logic for more robust line number tracking, especially for empty files or files without trailing newlines.
- Refined `SourceFile::fill_the_buffer()` to use `std::filesystem::path` consistently.
- Significantly enhanced parser error reporting:
    - Errors now show file, line, column, the problematic token, and the line of code with a marker.
    - `Parser::ReportError` method added for centralized error handling.
- Removed a duplicated line in the "Known limitations" section of README.md.
- Added a basic parser test (`ParserTest.HandlesSimpleFunction`):
    - Includes a new sample file `test/sample_parser_0.AL`.
    - Verifies that a simple function declaration is parsed correctly without errors.
- Updated CMakeLists.txt to include the new parser test and ensure proper linking.

These changes provide a better understanding of the project's current state, fix several small bugs, and lay a better foundation for future development by improving the parser's utility and test coverage.
@abdoei
Copy link
Owner Author

abdoei commented May 22, 2025

As expected it didn't even build 🙂

@abdoei
Copy link
Owner Author

abdoei commented May 22, 2025

On having time, I would review it and see what Jules is trying to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant