Example #1
0
        public override void EnterVarDecl(GoParser.VarDeclContext context)
        {
            // varDecl
            //     : 'var' ( varSpec | '(' ( varSpec eos )* ')' )

            m_varIdentifierCount     = 0;
            m_varMultipleDeclaration = context.children.Count > 2;
        }
Example #2
0
        public override void ExitVarDecl(GoParser.VarDeclContext context)
        {
            // varDecl
            //     : 'var' ( varSpec | '(' ( varSpec eos )* ')' )

            if (m_varMultipleDeclaration && EndsWithLineFeed(m_targetFile.ToString()))
            {
                string removedLineFeed = RemoveLastLineFeed(m_targetFile.ToString());
                m_targetFile.Clear();
                m_targetFile.Append(removedLineFeed);
            }

            m_targetFile.Append(CheckForCommentsRight(context));
        }