Ejemplo n.º 1
0
 private void PreinitCtor(DCtorPattern node, Hints hints)
 {
     if (node.Arguments != null && node.Arguments.Count > 0)
     {
         PreinitSequence(node.Arguments, hints);
     }
 }
Ejemplo n.º 2
0
        private void BuildCtor(DCtorPattern node, Hints hints, CompilerContext ctx)
        {
            var bad = cw.DefineLabel();
            var ok  = cw.DefineLabel();

            cw.Dup();

            var nameId = GetMemberNameId(node.Constructor);

            cw.CtorCheck(nameId);
            cw.Brfalse(bad);

            if (node.Arguments == null || node.Arguments.Count == 0)
            {
                cw.Pop();
                cw.Push(true);
            }
            else
            {
                BuildSequence(node, node.Arguments, hints, ctx);
            }

            cw.Br(ok);

            cw.MarkLabel(bad);
            AddLinePragma(node);
            cw.Pop();
            cw.Push(false);

            cw.MarkLabel(ok);
        }
Ejemplo n.º 3
0
    private void BuildCtor(DCtorPattern node, Hints hints, CompilerContext ctx)
    {
        var bad = cw.DefineLabel();
        var ok  = cw.DefineLabel();

        if (node.TypeName is not null)
        {
            cw.Dup();
            PushTypeInfo(ctx, node.TypeName, node.Location);
            cw.TypeCheck();
            cw.Brfalse(bad);
        }

        cw.Dup();
        cw.CtorCheck(node.Constructor);
        cw.Brfalse(bad);

        if (node.Arguments is null || node.Arguments.Count is 0)
        {
            cw.Pop();
            cw.Push(true);
        }