Ejemplo n.º 1
0
 public override void ExitStructType(GoParser.StructTypeContext context)
 {
     // TODO: Turn into a strongly typed object and declare prior to function
     // All intra-function scoped declared structures are
     // defined as dynamic so they can behave like ducks
     Types[context.Parent.Parent] = TypeInfo.DynamicType;
 }
Ejemplo n.º 2
0
        public override void ExitStructType(GoParser.StructTypeContext context)
        {
            List <FieldInfo> fields = new List <FieldInfo>();

            for (int i = 0; i < context.fieldDecl().Length; i++)
            {
                GoParser.FieldDeclContext fieldDecl = context.fieldDecl(i);
                string description = ToStringLiteral(fieldDecl.string_()?.GetText());

                if (Identifiers.TryGetValue(fieldDecl.identifierList(), out string[] identifiers) && Types.TryGetValue(fieldDecl.type_(), out TypeInfo typeInfo))