修复了注释相关的分段错误
This commit is contained in:
@@ -56,16 +56,8 @@ namespace Convention.RScript
|
|||||||
// Skip single-line comment
|
// Skip single-line comment
|
||||||
if (line[i + 1] == '/')
|
if (line[i + 1] == '/')
|
||||||
{
|
{
|
||||||
while (i < line.Length && line[i] != '\n')
|
PushBuilder();
|
||||||
i++;
|
break;
|
||||||
}
|
|
||||||
// Skip multi-line comment
|
|
||||||
else if (line[i + 1] == '*')
|
|
||||||
{
|
|
||||||
i += 2;
|
|
||||||
while (i + 1 < line.Length && !(line[i] == '*' && line[i + 1] == '/'))
|
|
||||||
i++;
|
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -74,9 +66,8 @@ namespace Convention.RScript
|
|||||||
}
|
}
|
||||||
else if (c == '#')
|
else if (c == '#')
|
||||||
{
|
{
|
||||||
// Skip single-line comment
|
PushBuilder();
|
||||||
while (i < line.Length && line[i] != '\n')
|
break;
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
else if (c == '\"')
|
else if (c == '\"')
|
||||||
{
|
{
|
||||||
@@ -126,10 +117,7 @@ namespace Convention.RScript
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (builder.Length > 0)
|
PushBuilder();
|
||||||
{
|
|
||||||
PushBuilder();
|
|
||||||
}
|
|
||||||
|
|
||||||
return statements.Where(s => !string.IsNullOrWhiteSpace(s));
|
return statements.Where(s => !string.IsNullOrWhiteSpace(s));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user