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