bug fix #731
This commit is contained in:
parent
9e3ccf8bcc
commit
a836092b36
|
|
@ -380,6 +380,11 @@ namespace CodeCompletion
|
|||
s = parser.LanguageInformation.FindExpression(off, test_str, line, col, out keyw);
|
||||
assert(s.Trim('\n', ' ', '\t') == "Seq(0)\n.f1\n.Print");
|
||||
|
||||
test_str = "$'is {a}'";
|
||||
off = test_str.Length-2;
|
||||
s = parser.LanguageInformation.FindExpression(off, test_str, line, col, out keyw);
|
||||
assert(s.Trim('\n', ' ', '\t') == "a");
|
||||
|
||||
int num_param = 0;
|
||||
//testirovanie nazhatija skobki
|
||||
test_str = "writeln";
|
||||
|
|
|
|||
|
|
@ -2719,6 +2719,8 @@ namespace PascalABCCompiler.Parsers
|
|||
{
|
||||
if (kav.Count == 0)
|
||||
{
|
||||
if (keyw == KeywordKind.None)
|
||||
return sb.ToString();
|
||||
sb.Insert(0, ch);
|
||||
break;
|
||||
}
|
||||
|
|
@ -3079,16 +3081,26 @@ namespace PascalABCCompiler.Parsers
|
|||
j--;
|
||||
Stack<char> kav_stack = new Stack<char>();
|
||||
j++;
|
||||
bool in_format_str = false;
|
||||
while (j <= i)
|
||||
{
|
||||
if (Text[j] == '\'')
|
||||
{
|
||||
if (kav_stack.Count == 0 && !in_keyw)
|
||||
kav_stack.Push('\'');
|
||||
{
|
||||
if (j == 0 || Text[j - 1] != '$')
|
||||
kav_stack.Push('\'');
|
||||
else
|
||||
{
|
||||
in_keyw = false;
|
||||
in_format_str = true;
|
||||
}
|
||||
|
||||
}
|
||||
else if (kav_stack.Count > 0)
|
||||
kav_stack.Pop();
|
||||
}
|
||||
else if (Text[j] == '{' && kav_stack.Count == 0)
|
||||
else if (Text[j] == '{' && kav_stack.Count == 0 && !in_format_str)
|
||||
in_keyw = true;
|
||||
else
|
||||
if (Text[j] == '}')
|
||||
|
|
|
|||
Loading…
Reference in a new issue