Fix for measure dependencies parsing

This commit is contained in:
Christian Wade 2022-06-21 17:17:25 -07:00
parent 6f16e97c1c
commit 624e5be5ea
3 changed files with 5 additions and 3 deletions

View File

@ -75,12 +75,14 @@ namespace BismNormalizer.TabularCompare.TabularMetadata
//Todo2: still need to parse for /* blah */ type comments. Currently can show missing dependency that doesn't apply if within a comment
string whatsRemainingOfLine = line;
int openSquareBracketPosition = 0;
int closeSquareBracketPosition = 0;
while (whatsRemainingOfLine.Contains('[') && whatsRemainingOfLine.Contains(']'))
while (whatsRemainingOfLine.Contains('[') && whatsRemainingOfLine.Contains(']') && openSquareBracketPosition != -1 && closeSquareBracketPosition != -1)
{
int openSquareBracketPosition = whatsRemainingOfLine.IndexOf('[', 0);
openSquareBracketPosition = whatsRemainingOfLine.IndexOf('[', 0);
//someone has ]] instead of ]
int closeSquareBracketPosition = whatsRemainingOfLine.Replace("]]", " ").IndexOf(']', openSquareBracketPosition + 1);
closeSquareBracketPosition = whatsRemainingOfLine.Replace("]]", " ").IndexOf(']', openSquareBracketPosition + 1);
if (openSquareBracketPosition < closeSquareBracketPosition - 1)
{