This commit is contained in:
Бондарев Иван 2019-12-25 12:27:01 +01:00
parent 179d86528e
commit b4ec2405a4
5 changed files with 26 additions and 2 deletions

View file

@ -964,6 +964,12 @@ namespace CodeCompletion
ExpressionVisitor ev = new ExpressionVisitor(expr, ss, visitor);
ev.mouse_hover = true;
ss = ev.GetScopeOfExpression();
if (ss == null && keyword == PascalABCCompiler.Parsers.KeywordKind.SquareBracket &&
expr is ident && !(expr as ident).name.EndsWith("Attribute"))
{
(expr as ident).name = (expr as ident).name + "Attribute";
ss = ev.GetScopeOfExpression();
}
}
if (ss != null && ss.si != null)
{

View file

@ -20,7 +20,7 @@ namespace PascalABCCompiler.Parsers
protected Dictionary<string, string> keywords = new Dictionary<string, string>(StringComparer.CurrentCultureIgnoreCase);
protected Hashtable ignored_keywords = new Hashtable(StringComparer.CurrentCultureIgnoreCase);
protected Hashtable keyword_kinds = new Hashtable(StringComparer.CurrentCultureIgnoreCase);
public DefaultLanguageInformation()
{
@ -2952,7 +2952,14 @@ namespace PascalABCCompiler.Parsers
}
}
else
{
end = true;
if (ch == '[')
{
keyw = KeywordKind.SquareBracket;
}
}
}
else sb.Insert(0, ch); punkt_sym = true;
break;

View file

@ -52,6 +52,7 @@ namespace PascalABCCompiler.Parsers
PointerType,
Colon,
Punkt,
SquareBracket,
ThrowNew,
CommonKeyword,
CommonExpressionKeyword

View file

@ -778,7 +778,6 @@ namespace PascalABCCompiler.VBNETParser
//if (j>= 0 && Text[j] == '\'') return CodeCompletion.KeywordKind.kw_punkt;
while (i >= 0 && (Text[i] == ' ' || char.IsControl(Text[i]))) i--;
if (i >= 0 && Text[i] == ':') return PascalABCCompiler.Parsers.KeywordKind.Colon;
if (i >= 0 && Text[i] == ',')
{

View file

@ -0,0 +1,11 @@
uses System.Runtime.CompilerServices;
[MethodImpl{@sealed class System.Runtime.CompilerServices.MethodImplAttribute@}]
procedure p1 := exit;
[MethodImplAttribute{@sealed class System.Runtime.CompilerServices.MethodImplAttribute@}]
procedure p2 := exit;
begin
end.