Skip to content
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

Flee.Parsing.grammatica_1._5.alpha2.PerCederberg.Grammatica.Runtime.RE.RegExpException: 'invalid repeat count: '{1,3})?(d|f|m)?' at position 18' #93

Open
benzmarkus opened this issue Aug 9, 2021 · 1 comment

Comments

@benzmarkus
Copy link

benzmarkus commented Aug 9, 2021

CalculationEngine engine = new CalculationEngine();
ExpressionContext context = new ExpressionContext();
int interest = 2;
context.Variables.Add("interest", interest);
BatchLoader loader = engine.CreateBatchLoader();

Write a small program with those lines and enable "Common Language Runtime Exceptions" in Visual Studio Exceptions Settings and it throws an exception.

Why does this happen?

In our production tool, we get 100 messages per second and we need to validate them with flee expressions. For each expression, we create a new ExpressionContext for the validation.
How can i prevent this error exception?

@hunkydoryrepair
Copy link
Contributor

why create a new ExpressionContext for each expression? There is a lot of overhead in general for each context, so reuse it where possible.

@mparlak just merged in a fix for those exceptions. I'd expect an updated release soon.

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

No branches or pull requests

2 participants