Exemple #1
0
 public Catch(ComponentReader reader)
 {
     fileOffset = new FileOffset(reader);
     guard      = reader.ReadDartType();
     exception  = reader.ReadOption(r => new VariableDeclaration(r));
     stackTrace = reader.ReadOption(r => new VariableDeclaration(r));
     body       = reader.ReadStatement();
 }
Exemple #2
0
        public readonly Option <DartType> defaultType; // type used when the parameter is not passed

        public TypeParameter(ComponentReader reader)
        {
            flags       = (Flag)reader.ReadByte();
            annotations = reader.ReadList(r => r.ReadExpression());
            name        = new StringReference(reader);
            bound       = reader.ReadDartType();
            defaultType = reader.ReadOption(r => r.ReadDartType());
        }
Exemple #3
0
        // Equivalent to a FunctionType with no type parameters or named parameters,
        // and where all positional parameters are required.

        public SimpleFunctionType(ComponentReader reader)
        {
            positionalParameters = reader.ReadList(r => r.ReadDartType());

            // https://github.com/dart-lang/sdk/blob/master/pkg/kernel/lib/binary/ast_from_binary.dart#L1889
            // MISSING!
            // positionalParameterNames = reader.ReadList(r => new StringReference(r));
            // Console.WriteLine(string.Join(", ", positionalParameterNames.Select(n => reader.GetString(n.index))));
            returnType = reader.ReadDartType();
        }
Exemple #4
0
        public Field(ComponentReader reader)
        {
            reader.CheckTag(Tag);

            canonicalName = new CanonicalNameReference(reader);
            fileUri       = new UriReference(reader);
            fileOffset    = new FileOffset(reader);
            fileEndOffset = new FileOffset(reader);
            flags         = (Flag)reader.ReadByte();
            name          = new Name(reader);
            annotations   = reader.ReadList(r => r.ReadExpression());
            type          = reader.ReadDartType();
            initializer   = reader.ReadOption(r => r.ReadExpression());
        }
Exemple #5
0
        public FunctionType(ComponentReader reader)
        {
            typeParameters         = reader.ReadList(r => new TypeParameter(r));
            requiredParameterCount = reader.ReadUint();
            totalParameterCount    = reader.ReadUint();
            positionalParameters   = reader.ReadList(r => r.ReadDartType());
            namedParameters        = reader.ReadList(r => new NamedDartType(r));

            // #v12:   CanonicalNameReference typedefReference;
            // #v12+:  Option<TypedefType> typedef;
            typedefReference = new CanonicalNameReference(reader);
            //typedef = reader.ReadOption(r => new TypedefType(r));

            returnType = reader.ReadDartType();
        }
Exemple #6
0
 public NamedDartType(ComponentReader reader)
 {
     name = new StringReference(reader);
     type = reader.ReadDartType();
 }