-
-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Entire data object is included in output on ParseError, when ParseErrorAction is set to anything other than ThrowError #143
Comments
Hi, Looks like for So, yes, the other error actions could be implemented. I'm a bit in doubt, whether anything else than When implemented, in your example, the results would look like this: MaintainTokens: Ignore: (an empty string) OutputErrorInResult: ThrowException: What do you think? |
I think your proposed result for MaintainTokens makes sense. Regarding |
This kind of |
I see you point. Sounds good!
Sure thing |
Great! Should go into |
Implementing the tests now. When I use the template MaintainTokens give me And the parser error says "SmartFormat.Core.Parsing.ParsingErrors : The format string has 3 issues: With Is it possible to make the parser leave the current expression on the first error, so that it can successfully parse correct expressions later in the string? |
"Invalid character in the selector" is connected to the parser settings. AlphaNumeric selectors must be enabled, then this error should vanish.
…________________________________
Von: Anders Jonsson <[email protected]>
Gesendet: Mittwoch, 17. Februar 2021 10:14
An: axuno/SmartFormat <[email protected]>
Cc: Norbert Bietsch <[email protected]>; Comment <[email protected]>
Betreff: Re: [axuno/SmartFormat] Entire data object is included in output on ParseError, when ParseErrorAction is set to anything other than ThrowError (#143)
Implementing the tests now.
When I use the template Hello, I'm {Name from {City}
and the input new { Name = "John", City = "Oklahoma" }
MaintainTokens give me Hello, I'm {Name from {City}. I was expecting Hello, I'm {Name from Oklahoma
And the parser error says "SmartFormat.Core.Parsing.ParsingErrors : The format string has 3 issues:
Invalid character in the selector, Invalid character in the selector, Invalid character in the selector"
With Hello, I'm {Name it says "SmartFormat.Core.Parsing.ParsingErrors : The format string has 1 issue:
Format string is missing a closing brace". A more correct description of the problem IMHO.
Is it possible to make the parser leave the current expression on the first error, so that it can successfully parse correct expressions later in the string?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#143 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACOH2MHOIDPKWW5XT4ZBC5DS7N3FXANCNFSM4XUJNOSQ>.
|
Short answer: no |
Oh, that's too bad. Now I see why you didn't think anything else than I'll send a PR with the tests shortly |
Thanks a lot. Will be able to have a deeper look tonight (CET). |
* Reference to issues #148, #147, #143 * Updated README.md * Fix for #149 (comment) * Update CHANGES.md
Template:
"Hello {Name"
That template is clearly missing an end curly brace
So far so good.
But after setting Smart.Default.Settings.ParseErrorAction I get an unexpected output.
That doesn't seem like the intended behavior. Am I missing something?
The text was updated successfully, but these errors were encountered: