Skip to content

Conversation

@gerlero
Copy link
Owner

@gerlero gerlero commented Dec 15, 2025

Closes #730

@gerlero gerlero requested a review from Copilot December 15, 2025 18:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for parsing coded source blocks (delimited by #{ and #}) in FoamFile format, addressing issue #730. The implementation allows code blocks to be properly parsed and round-tripped through the serialization/deserialization process.

  • Updated the token parser to recognize and handle #{...#} code block syntax
  • Added test case demonstrating the new functionality with a coded function object
  • Removed the xfail marker from an existing test that now passes with this support

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/foamlib/_files/_parsing/_parser.py Modified token parsing logic to detect and handle coded source blocks delimited by #{ and #}
tests/test_files/test_parsing/test_coded.py Added new test case verifying round-trip serialization of coded function objects
tests/test_files/test_parsing/test_intermediate.py Removed xfail marker from test that now passes with coded block support

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gerlero gerlero requested a review from Copilot December 15, 2025 19:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

tests/test_files/test_parsing/test_coded.py:1

  • The test string uses escaped backslashes and line continuation which makes it difficult to read. Consider using a multiline string or raw string literal to improve readability and maintainability of the test case.
from foamlib import FoamFile

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gerlero gerlero requested a review from Copilot December 15, 2025 20:35
@gerlero gerlero merged commit 9c541b2 into main Dec 15, 2025
41 checks passed
@gerlero gerlero deleted the coded branch December 15, 2025 20:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

Add support for coded source blocks #{ ... #}

2 participants