diff --git a/CodeCompletion/Testing.cs b/CodeCompletion/Testing.cs index 49d6b9a74..b0632549c 100644 --- a/CodeCompletion/Testing.cs +++ b/CodeCompletion/Testing.cs @@ -546,8 +546,14 @@ namespace CodeCompletion s = parser.LanguageInformation.FindExpressionForMethod(off,test_str,line,col,'(',ref num_param); assert(s.Trim(' ','\n','\t') == "Console.WriteLine"); assert(num_param==0); - - test_str = "&var.&uses.&procedure"; + + test_str = "System.Math.DivRem"; + off = test_str.Length; + s = parser.LanguageInformation.FindExpressionForMethod(off, test_str, line, col, '(', ref num_param); + assert(s.Trim(' ', '\n', '\t') == "System.Math.DivRem"); + assert(num_param == 0); + + test_str = "&var.&uses.&procedure"; off = test_str.Length; s = parser.LanguageInformation.FindExpressionForMethod(off,test_str,line,col,'(',ref num_param); assert(s == test_str); @@ -682,6 +688,8 @@ namespace CodeCompletion assert(s.Trim(' ', '\n', '\t') == "Power"); assert(num_param == 2); + + string str = null; //mouse hover test_str = "sin(2)"; diff --git a/ParserTools/ParserTools/DefaultLanguageInformation.cs b/ParserTools/ParserTools/DefaultLanguageInformation.cs index c5fc57e4c..5d80d1649 100644 --- a/ParserTools/ParserTools/DefaultLanguageInformation.cs +++ b/ParserTools/ParserTools/DefaultLanguageInformation.cs @@ -2513,7 +2513,7 @@ namespace PascalABCCompiler.Parsers string op = Text.Substring(i - 2, 3).ToLower().Trim(); if (op == "and" || op == "div" || op == "mod" || op == "xor") { - if (!char.IsLetterOrDigit(Text[i - 3]) && Text[i - 3] != '_' && Text[i - 3] != '&') + if (!char.IsLetterOrDigit(Text[i - 3]) && Text[i - 3] != '_' && Text[i - 3] != '&' && !(i + 1 < Text.Length && char.IsLetterOrDigit(Text[i + 1]))) { next = i - 3; return true;