Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems when using "," in comments #1

Closed
m47812 opened this issue Apr 3, 2022 · 1 comment
Closed

Problems when using "," in comments #1

m47812 opened this issue Apr 3, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@m47812
Copy link
Owner

m47812 commented Apr 3, 2022

Verilog uses "," as a separate character. When also using "," in the signal description comments the separation by "," does not work. Error was attempted to fix with the following method to clean the split. It was Removed again because it leads to other possibly more severe issues in the last signal which does not have a comma in Verilog. A Better solution would be to rebuild separate elements and use a different method to separate the elements.

        /// This Function Cleans splits that happend from comments containing a separation charracter like "," 
        /// that is used in code.
        /// </summary>
        /// <param name="input">A string splited by the separation character of the HDL language (Verilog --> ,)</param>
        /// <param name="commentChar">The Syntax for a Comment in the HDL (Verilog --> "//")</param>
        /// <returns>the cleand verion of the input data</returns>
        public static string[] cleanSplitedElements(string[] input, string commentChar)
        {
            if (input.Length == 1) return input;
            List<string> correctedSplited = new List<string>();
            for (int i = 0; i < input.Length - 1; i++)
            {
                if (input[i].Contains(commentChar) && !input[i].Contains(System.Environment.NewLine))
                {
                    correctedSplited.Add(input[i] +" "+ input[i + 1]);
                    i++;
                }
                else
                {
                    correctedSplited.Add(input[i]);
                    if(i == input.Length - 2) correctedSplited.Add(input[i+1]);
                }
            }
            return correctedSplited.ToArray();
        }
@m47812 m47812 added the bug Something isn't working label Apr 3, 2022
@m47812
Copy link
Owner Author

m47812 commented Apr 3, 2022

Problem Solved by redesign of the separate method.

@m47812 m47812 closed this as completed Apr 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant