Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IL name override fix #1178

Merged
merged 1 commit into from
May 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
]
},
"ghul.compiler": {
"version": "0.8.45",
"version": "0.8.46",
"commands": [
"ghul-compiler"
]
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>0.8.46-alpha.4</Version>
<Version>0.8.47-alpha.5</Version>
<NoWarn>$(NoWarn);NU1507</NoWarn>
</PropertyGroup>
<ItemGroup>
Expand Down
16 changes: 0 additions & 16 deletions src/semantic/dotnet/type_details.ghul
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,6 @@ namespace Semantic.DotNet is
self.version_number = version_number;
si

init(
dotnet_type: TYPE,
assembly_name: string,
version_number: string
) is
assert dotnet_type? else "dotnet_type is null";

self.dotnet_type = dotnet_type;

self.ghul_namespace = dotnet_type.`namespace;
self.ghul_type_name = dotnet_type.name;
self.il_name = dotnet_type.name;
self.assembly_name = assembly_name;
self.version_number = version_number;
si

matches(namespace_name: string, name: string) -> bool =>
namespace_name =~ ghul_namespace /\ name =~ ghul_type_name;

Expand Down
11 changes: 6 additions & 5 deletions src/semantic/symbols/classy.ghul
Original file line number Diff line number Diff line change
Expand Up @@ -396,16 +396,20 @@ namespace Semantic.Symbols is
buffer.append(".");
si

gen_dotted_name(buffer: System.Text.StringBuilder, qualifying: Scope) is
gen_dotted_name(buffer: System.Text.StringBuilder, qualifying: Scope) is
let iln = il_name_override;

if iln? then
let parts = il_name_override.split(['[',']']);

if parts.count == 3 then
buffer
.append(parts[2]);
else
if owner? /\ !iln.contains('.') then
owner.gen_dotted_name(buffer, self);
fi

buffer.append(iln);
fi
else
Expand Down Expand Up @@ -1057,9 +1061,6 @@ namespace Semantic.Symbols is

declare(location, `field, symbol_definition_listener);

// FIXME: this doesn't seem like it does anything
`field.il_name_override = `field.il_name_override;

`field.set_type(type);

_captures.add(`field);
Expand Down
19 changes: 9 additions & 10 deletions src/semantic/symbols/symbol.ghul
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,16 @@ namespace Semantic.Symbols is

qualified_name: string =>
if owner? then
return owner.qualify(name);
owner.qualify(name);
else
return name;
name;
fi;

il_name: string =>
if il_name_override? then
return il_name_override;
il_name_override;
else
return "'{name}'";
"'{name}'";
fi;

il_name_override: string public;
Expand All @@ -151,15 +151,14 @@ namespace Semantic.Symbols is

specialized_from: Symbol public;

root_specialized_from: Symbol is
let sf = specialized_from;
root_specialized_from: Symbol =>
let sf = specialized_from in

if sf? then
return sf.root_specialized_from;
sf.root_specialized_from;
else
return self;
fi
si
self;
fi;

access: ACCESS => ACCESS.PUBLIC;

Expand Down
2 changes: 1 addition & 1 deletion src/syntax/process/declare_symbols.ghul
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ namespace Syntax.Process is
fi

if is_primitive then
symbol.il_is_primitive_type = true;
symbol.il_is_primitive_type = true;
fi

symbol.il_name_override = il_name;
Expand Down
Loading