Пример #1
0
        private void WriteVar_(miranaParser.Var_Context context)
        {
            var suffixes = context.varSuffix();

            if (context.NAME() != null)
            {
                WriteImmediately(context.NAME().GetText());
            }
            else if (context.lambdaImplicitParam() != null)
            {
                WriteImmediately(GetLambdaImplicitParamName(context.lambdaImplicitParam().Num));
            }
            else if (context.it() != null)
            {
                WriteImmediately(GetLambdaImplicitIterName());
            }
            else
            {
                WriteImmediately('(');
                WriteExp(context.exp());
                WriteImmediately(')');
            }
            foreach (var suffix in suffixes)
            {
                WriteVarSuffix(suffix);
            }
        }
Пример #2
0
        private void WriteVar_NoLast(miranaParser.Var_Context context)
        {
            var suffixes = context.varSuffix();

            if (context.NAME() != null)
            {
                WriteImmediately(context.NAME().GetText());
            }
            else
            {
                WriteImmediately('(');
                WriteExp(context.exp());
                WriteImmediately(')');
            }
            foreach (var suffix in suffixes.SkipLast(1))
            {
                WriteVarSuffix(suffix);
            }
        }