ecsharp icon indicating copy to clipboard operation
ecsharp copied to clipboard

The error Semicolon': expected Colon for the specific code

Open dadhi opened this issue 5 years ago • 2 comments
trafficstars

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 avatar Nov 23 '20 08:11 dadhi

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

qwertie avatar Nov 23 '20 14:11 qwertie

I thought that ?. was a single operator

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

dadhi avatar Nov 23 '20 18:11 dadhi