Ejemplo n.º 1
0
        public override void EnterTypeDecl(GolangParser.TypeDeclContext context)
        {
            // typeDecl
            //     : 'type' ( typeSpec | '(' ( typeSpec eos )* ')' )

            m_typeIdentifierCount = 0;
            m_typeMultipleDeclaration = context.children.Count > 2;
        }
Ejemplo n.º 2
0
        public override void ExitTypeDecl(GolangParser.TypeDeclContext context)
        {
            // typeDecl
            //     : 'type' ( typeSpec | '(' ( typeSpec eos )* ')' )

            if (m_typeMultipleDeclaration && EndsWithLineFeed(m_targetFile.ToString()))
            {
                string removedLineFeed = RemoveLastLineFeed(m_targetFile.ToString());
                m_targetFile.Clear();
                m_targetFile.Append(removedLineFeed);
            }
        }
Ejemplo n.º 3
0
        // TODO: Consider strongly typing sub-function type declarations with function name prefix declared directly prior to function definition - sub-function type declarations are syntactically invalid in C#

        public override void EnterTypeDecl(GolangParser.TypeDeclContext context)
        {
            m_firstTypeSpec = !m_inFunction;
        }