Пример #1
0
        public override void ExitConstSpec(GolangParser.ConstSpecContext context)
        {
            // constSpec
            //     : identifierList ( type ? '=' expressionList ) ?

            if (m_constIdentifierCount == 0 && m_constMultipleDeclaration)
            {
                m_targetFile.Append(RemoveFirstLineFeed(CheckForCommentsLeft(context)));
            }

            if (!Identifiers.TryGetValue(context.identifierList(), out string[] identifiers))
Пример #2
0
        // TODO: This needs work - need to use an expression type evaluator
        public override void ExitConstSpec(GolangParser.ConstSpecContext context)
        {
            // constSpec
            //     : identifierList ( type ? '=' expressionList ) ?

            if (m_firstConstSpec)
            {
                m_firstConstSpec = false;

                string comments = CheckForCommentsLeft(context, preserveLineFeeds: m_inFunction);

                if (!string.IsNullOrEmpty(comments))
                {
                    m_targetFile.Append(FixForwardSpacing(comments));
                }
            }

            if (!Identifiers.TryGetValue(context.identifierList(), out string[] identifiers))