fix #1423
This commit is contained in:
parent
853fdb4fc4
commit
e33ed6599b
|
|
@ -1439,13 +1439,13 @@ namespace PascalABCCompiler.Parsers
|
|||
}
|
||||
break;
|
||||
case SymbolKind.Event:
|
||||
if (scope.IsStatic) sb.Append("class ");
|
||||
if (scope.IsStatic) sb.Append("static ");
|
||||
sb.Append("event " + GetTopScopeName(scope.TopScope) + scope.Name + ": " + type_name);
|
||||
append_modifiers(sb, scope);
|
||||
break;
|
||||
case SymbolKind.Field:
|
||||
if (scope.IsStatic)
|
||||
sb.Append("class ");
|
||||
sb.Append("static ");
|
||||
else
|
||||
sb.Append("var ");
|
||||
sb.Append(GetTopScopeName(scope.TopScope) + scope.Name + ": " + type_name);
|
||||
|
|
@ -1455,7 +1455,7 @@ namespace PascalABCCompiler.Parsers
|
|||
break;
|
||||
case SymbolKind.Property:
|
||||
if (scope.IsStatic)
|
||||
sb.Append("class ");
|
||||
sb.Append("static ");
|
||||
sb.Append("property " + GetTopScopeName(scope.TopScope) + scope.Name + get_index_description(scope) + ": " + type_name);
|
||||
if (scope.IsReadOnly)
|
||||
sb.Append("; readonly");
|
||||
|
|
@ -1482,7 +1482,7 @@ namespace PascalABCCompiler.Parsers
|
|||
else if (fi.IsFamily)
|
||||
sb.Append("protected ");
|
||||
if (!fi.IsLiteral)
|
||||
if (fi.IsStatic) sb.Append("class ");
|
||||
if (fi.IsStatic) sb.Append("static ");
|
||||
if (!fi.IsLiteral)
|
||||
{
|
||||
sb.Append(prepare_member_name(fi.Name));
|
||||
|
|
@ -1501,7 +1501,7 @@ namespace PascalABCCompiler.Parsers
|
|||
{
|
||||
System.Text.StringBuilder sb = new System.Text.StringBuilder();
|
||||
if (!scope.CompiledField.IsLiteral)
|
||||
if (scope.CompiledField.IsStatic && !scope.IsGlobal) sb.Append("class ");
|
||||
if (scope.CompiledField.IsStatic && !scope.IsGlobal) sb.Append("static ");
|
||||
else sb.Append("var ");
|
||||
string inst_type = null;
|
||||
if (scope.GenericArgs != null)
|
||||
|
|
@ -1543,7 +1543,7 @@ namespace PascalABCCompiler.Parsers
|
|||
sb.Append("public ");
|
||||
else if (get_meth.IsFamily)
|
||||
sb.Append("protected ");
|
||||
if (get_meth.IsStatic) sb.Append("class ");
|
||||
if (get_meth.IsStatic) sb.Append("static ");
|
||||
sb.Append("property " + prepare_member_name(pi.Name));
|
||||
ParameterInfo[] prms = get_meth.GetParameters();
|
||||
if (prms.Length > 0)
|
||||
|
|
@ -1572,7 +1572,7 @@ namespace PascalABCCompiler.Parsers
|
|||
MethodInfo acc = scope.CompiledProperty.GetGetMethod();
|
||||
string inst_type = null;
|
||||
if (acc != null)
|
||||
if (acc.IsStatic) sb.Append("class ");
|
||||
if (acc.IsStatic) sb.Append("static ");
|
||||
if (scope.Type is ICompiledTypeScope && scope.GenericArgs != null)
|
||||
{
|
||||
Type t = (scope.Type as ICompiledTypeScope).CompiledType;
|
||||
|
|
@ -1683,7 +1683,7 @@ namespace PascalABCCompiler.Parsers
|
|||
sb.Append("public ");
|
||||
else if (mi.IsFamily)
|
||||
sb.Append("protected ");
|
||||
if (mi.IsStatic) sb.Append("class ");
|
||||
if (mi.IsStatic) sb.Append("static ");
|
||||
if (mi.ReturnType == typeof(void))
|
||||
sb.Append("procedure ");
|
||||
else
|
||||
|
|
@ -1761,7 +1761,7 @@ namespace PascalABCCompiler.Parsers
|
|||
}
|
||||
}
|
||||
|
||||
if (scope.IsStatic && !scope.IsGlobal) sb.Append("class ");
|
||||
if (scope.IsStatic && !scope.IsGlobal) sb.Append("static ");
|
||||
if (scope.ReturnType == null)
|
||||
sb.Append("procedure ");
|
||||
else
|
||||
|
|
@ -1958,7 +1958,7 @@ namespace PascalABCCompiler.Parsers
|
|||
}
|
||||
}
|
||||
|
||||
if (scope.IsStatic) sb.Append("class ");
|
||||
if (scope.IsStatic) sb.Append("static ");
|
||||
if (scope.IsConstructor())
|
||||
sb.Append("constructor ");
|
||||
else
|
||||
|
|
@ -2073,13 +2073,13 @@ namespace PascalABCCompiler.Parsers
|
|||
sb.Append("public ");
|
||||
else if (add_meth.IsFamily)
|
||||
sb.Append("protected ");
|
||||
sb.Append((add_meth.IsStatic ? "class " : "") + "event " + prepare_member_name(ei.Name) + ": " + GetFullTypeName(ei.EventHandlerType) + ";");
|
||||
sb.Append((add_meth.IsStatic ? "static " : "") + "event " + prepare_member_name(ei.Name) + ": " + GetFullTypeName(ei.EventHandlerType) + ";");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
protected virtual string GetDescriptionForCompiledEvent(ICompiledEventScope scope)
|
||||
{
|
||||
return (scope.IsStatic?"class ":"")+"event "+ GetShortTypeName(scope.CompiledEvent.DeclaringType, true) +"."+ scope.CompiledEvent.Name + ": "+GetSimpleDescription(scope.Type)+ ";";
|
||||
return (scope.IsStatic?"static ":"")+"event "+ GetShortTypeName(scope.CompiledEvent.DeclaringType, true) +"."+ scope.CompiledEvent.Name + ": "+GetSimpleDescription(scope.Type)+ ";";
|
||||
}
|
||||
|
||||
protected virtual string GetDescriptionForCompiledConstructor(ConstructorInfo ci)
|
||||
|
|
@ -2090,7 +2090,7 @@ namespace PascalABCCompiler.Parsers
|
|||
else if (ci.IsFamily)
|
||||
sb.Append("protected ");
|
||||
if (ci.IsStatic)
|
||||
sb.Append("class ");
|
||||
sb.Append("static ");
|
||||
sb.Append("constructor ");
|
||||
//sb.Append(".");
|
||||
//sb.Append("Create");
|
||||
|
|
@ -2450,7 +2450,7 @@ namespace PascalABCCompiler.Parsers
|
|||
bool is_cnstr = false;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (scope.IsStatic)
|
||||
sb.Append("class ");
|
||||
sb.Append("static ");
|
||||
while (i < meth.Length && char.IsLetterOrDigit(meth[i]))
|
||||
{
|
||||
sb.Append(meth[i++]);
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@ end;
|
|||
begin
|
||||
var rem32: integer;
|
||||
var rem64: int64;
|
||||
System.Math.DivRem{@class function Math.DivRem(a: integer; b: integer; var result: integer): integer;@}(1, 1, rem32);
|
||||
System.Math.DivRem{@class function Math.DivRem(a: int64; b: int64; var result: int64): int64;@}(1, 1, rem64);
|
||||
System.Math.DivRem{@static function Math.DivRem(a: integer; b: integer; var result: integer): integer;@}(1, 1, rem32);
|
||||
System.Math.DivRem{@static function Math.DivRem(a: int64; b: int64; var result: int64): int64;@}(1, 1, rem64);
|
||||
mydivrem{@function mydivrem(a: integer; b: integer; var r: integer): integer;@}(1, 1, rem32);
|
||||
mydivrem{@function mydivrem(a: int64; b: int64; var r: int64): int64;@}(1, 1, rem64);
|
||||
end.
|
||||
Loading…
Reference in a new issue