예제 #1
0
        public override void EnterConstDecl(GolangParser.ConstDeclContext context)
        {
            // constDecl
            //     : 'const' ( constSpec | '(' ( constSpec eos )* ')' )

            m_constIdentifierCount     = 0;
            m_constMultipleDeclaration = context.children.Count > 2;
            m_iota = 0;
        }
예제 #2
0
        public override void ExitConstDecl(GolangParser.ConstDeclContext context)
        {
            // constDecl
            //     : 'const' ( constSpec | '(' ( constSpec eos )* ')' )

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

            m_targetFile.Append(CheckForCommentsRight(context));
        }
예제 #3
0
 public override void EnterConstDecl(GolangParser.ConstDeclContext context)
 {
     m_firstConstSpec = !m_inFunction;
     m_iota           = 0;
 }