This commit is contained in:
Ivan Bondarev 2023-03-12 11:59:02 +01:00
parent c5cc20572a
commit d5a2d9205d
3 changed files with 21 additions and 2 deletions

View file

@ -489,11 +489,21 @@ namespace GPPGParserScanner
}
}
string str2 = sb.ToString();
if (str2.Trim().EndsWith("{"))
{
parsertools.errors.Add(new bad_format_string(parsertools.CurrentFileName, str.source_context, str));
return str;
int cnt = 0;
string tmp = str2.Trim();
for (var i = 0; i < tmp.Length; i++)
if (tmp[i] == '{')
cnt++;
if (cnt % 2 == 1)
{
parsertools.errors.Add(new bad_format_string(parsertools.CurrentFileName, str.source_context, str));
return str;
}
}
mc.parameters.Add(new string_const(str2, str.source_context), str.source_context);
for (int i = 0; i < vars.Count; i++)

View file

@ -0,0 +1,3 @@
begin
var s := $'{{{';
end.

View file

@ -0,0 +1,6 @@
begin
var s := $'{{';
assert(s = '{');
s := $'{{{{';
assert(s = '{{');
end.