Skip to content

Conversation

emayevski
Copy link
Contributor

As mentioned in the issue.

… it considers to be a group separator of a number before the character.
@sebastienros
Copy link
Owner

Do you feel like being able to add two unit tests? Search for where the current tests on numbers and groups are.

  • one that would try to parse a number from 123,, 123,a
  • one that would parse the example you provided in the issue

And also revert the formatting change after the if?

@sebastienros
Copy link
Owner

Also note that this change is breaking some tests

@emayevski
Copy link
Contributor Author

Sure, I will add the tests. As for the existing tests failing - it is necessary to look what is wrong with the test or with expressions, or maybe even add some policy, because the example I provided is clearly valid.

@sebastienros
Copy link
Owner

Here is a test that fails after your changes:

Assert.Equal((decimal)123456, Literals.Number<decimal>(NumberOptions.Any, groupSeparator: '|').Parse("123|456"));

@emayevski
Copy link
Contributor Author

Here is a test that fails after your changes:

Assert.Equal((decimal)123456, Literals.Number<decimal>(NumberOptions.Any, groupSeparator: '|').Parse("123|456"));

yes, thank you, I see what I have missed. Fixing this now. All the tests are passing, and I am to add some more.

@emayevski
Copy link
Contributor Author

I have made the necessary changes and additions.

@sebastienros
Copy link
Owner

Could you remove the restriction for me to edit your PRs? There should be a setting in your fork, and the setting usually allows repos owner to edit PRs by default. That allows me to contribute to it.

@emayevski
Copy link
Contributor Author

@sebastienros I feel ashamed, but I cannot find a corresponding setting within the fork. ChatGPT tells me that this should be a setting for this specific pull request, and if it is missing, this may be because of the pull request settings. If you tell me what you want to modify, I can amend my branch and this pull request, or close this request and try to create a new one with different settings. I have added you to the writers for my fork (just hoping that this may help). I am sorry for the hassle, I am not used to GitHub.

@lahma
Copy link
Collaborator

lahma commented Jun 4, 2025

There should be a checkbox on the right side navigation of this page:

image

@emayevski
Copy link
Contributor Author

There should be a checkbox on the right side navigation of this page:

Thank you for the example. This is something ChatGPT suggested as well, but there is nothing displayed for me below the "participants" section, i.e., there is no such option there. Possibly, this is because the pull request was created with too restrictive settings, or possibly because the fork belongs to an organization of mine, not to my personal profile.

@Genteure
Copy link
Contributor

Genteure commented Jun 4, 2025

Because this PR is submitted from a repository under an organization, edits from upstream maintainers is always disabled.

https://github.com/orgs/community/discussions/5634

@emayevski
Copy link
Contributor Author

@sebastienros This fix needs more work and tests ... I am working on this problem further now and will update the PR. I am sorry for the restrictions problems.

@sebastienros sebastienros changed the title The fix for issue #223 (scanner swallows a character that it considers to be a group separator of a number before the character) Fix position reset when parsing incmplete decimal group separator Jun 6, 2025
@sebastienros sebastienros merged commit 1d5ff4d into sebastienros:main Jun 6, 2025
1 check passed
@emayevski
Copy link
Contributor Author

Thank you!

@emayevski emayevski deleted the fix_scanner_group_sep_swallow branch June 6, 2025 19:02
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.

4 participants