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

The error Semicolon': expected Colon for the specific code #126

Open
dadhi opened this issue Nov 23, 2020 · 2 comments
Open

The error Semicolon': expected Colon for the specific code #126

dadhi opened this issue Nov 23, 2020 · 2 comments
Labels

Comments

@dadhi
Copy link

dadhi commented Nov 23, 2020

Given the following code:

using System;

static class X
{
    internal static bool TryGetUsedInstance(this IResolverContext r, int serviceTypeHash, Type serviceType, out object instance)
    {
        instance = null;
        return r.CurrentScope? .TryGetUsedInstance(r, serviceTypeHash, serviceType, out instance) == true 
            || r.SingletonScope.TryGetUsedInstance(r, serviceTypeHash, serviceType, out instance);
    }
}

I've got the error:

LeMP macro compiler (2.8.3.0)
Test3.ecs(9,98): Error: 'Semicolon': expected Colon
Test3.ecs(9,98): Error: ';': Expected an expression: (parentheses), {braces}, identifier, literal, or $substitution. 

Btw: I've started to play with running LeMP for the https://github.com/dadhi/DryIoc/blob/v5-dev/src/DryIoc/Container.cs
which is 14k of locs ;-) and for now, I've got only this error and #125 .

My biggest worry was the performance but for now, the LeMP output is almost instantaneous - which is a pleasant surprise! I will test it further when the mentioned problems are fixed.

@dadhi dadhi changed the title The error Semicolon': expected Colon The error Semicolon': expected Colon for the specific code Nov 23, 2020
@qwertie
Copy link
Owner

qwertie commented Nov 23, 2020

Ahh. I thought that ?. was a single operator (rather than a pair of separate tokens) so that's what the parser currently expects.

@dadhi
Copy link
Author

dadhi commented Nov 23, 2020

I thought that ?. was a single operator

Now I get it, can live with this - will change the code on my side.

@qwertie qwertie added the bug label Nov 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants