Browse Source

Enable DecompilerSettings.IntroduceLocalFunctions

pull/1586/head
Siegfried Pammer 6 years ago
parent
commit
0719aa9f08
  1. 3
      ICSharpCode.Decompiler/CSharp/StatementBuilder.cs
  2. 11
      ICSharpCode.Decompiler/DecompilerSettings.cs
  3. 6
      ILSpy/Properties/Resources.Designer.cs
  4. 4
      ILSpy/Properties/Resources.resx
  5. 6
      ILSpy/Properties/Resources.zh-Hans.resx

3
ICSharpCode.Decompiler/CSharp/StatementBuilder.cs

@ -726,7 +726,8 @@ namespace ICSharpCode.Decompiler.CSharp @@ -726,7 +726,8 @@ namespace ICSharpCode.Decompiler.CSharp
/// <summary>
/// Determines whether storeInst.Variable is only assigned once and used only inside <paramref name="usingContainer"/>.
/// Loads by reference (ldloca) are only allowed in the context of this pointer in call instructions.
/// Loads by reference (ldloca) are only allowed in the context of this pointer in call instructions,
/// or as target of ldobj.
/// (This only applies to value types.)
/// </summary>
bool VariableIsOnlyUsedInBlock(StLoc storeInst, BlockContainer usingContainer)

11
ICSharpCode.Decompiler/DecompilerSettings.cs

@ -945,19 +945,16 @@ namespace ICSharpCode.Decompiler @@ -945,19 +945,16 @@ namespace ICSharpCode.Decompiler
bool localFunctions = true;
/// <summary>
/// Gets/Sets whether C# 7.0 local functions should be used.
/// Note: this language feature is currently not implemented and this setting is always false.
/// Gets/Sets whether C# 7.0 local functions should be transformed.
/// </summary>
[Category("C# 7.0 / VS 2017")]
[Description("DecompilerSettings.IntroduceLocalFunctionsNOTIMPLEMENTED")]
[Browsable(false)]
[Description("DecompilerSettings.IntroduceLocalFunctions")]
public bool LocalFunctions {
get { return localFunctions; }
set {
if (localFunctions != value) {
throw new NotImplementedException("C# 7.0 local functions are not implemented!");
//localFunctions = value;
//OnPropertyChanged();
localFunctions = value;
OnPropertyChanged();
}
}
}

6
ILSpy/Properties/Resources.Designer.cs generated

@ -700,11 +700,11 @@ namespace ICSharpCode.ILSpy.Properties { @@ -700,11 +700,11 @@ namespace ICSharpCode.ILSpy.Properties {
}
/// <summary>
/// Looks up a localized string similar to Introduce local functions (NOT IMPLEMENTED!).
/// Looks up a localized string similar to Introduce local functions.
/// </summary>
public static string DecompilerSettings_IntroduceLocalFunctionsNOTIMPLEMENTED {
public static string DecompilerSettings_IntroduceLocalFunctions {
get {
return ResourceManager.GetString("DecompilerSettings.IntroduceLocalFunctionsNOTIMPLEMENTED", resourceCulture);
return ResourceManager.GetString("DecompilerSettings.IntroduceLocalFunctions", resourceCulture);
}
}

4
ILSpy/Properties/Resources.resx

@ -702,8 +702,8 @@ @@ -702,8 +702,8 @@
<data name="DecompilerSettings.RemoveOptionalArgumentsIfPossible" xml:space="preserve">
<value>Remove optional arguments, if possible</value>
</data>
<data name="DecompilerSettings.IntroduceLocalFunctionsNOTIMPLEMENTED" xml:space="preserve">
<value>Introduce local functions (NOT IMPLEMENTED!)</value>
<data name="DecompilerSettings.IntroduceLocalFunctions" xml:space="preserve">
<value>Introduce local functions</value>
</data>
<data name="DecompilerSettings.NullableReferenceTypes" xml:space="preserve">
<value>Nullable reference types</value>

6
ILSpy/Properties/Resources.zh-Hans.resx

@ -676,7 +676,7 @@ @@ -676,7 +676,7 @@
<value>IsByRefLikeAttribute应替换为结构上的 "ref" 修饰符</value>
</data>
<data name="DecompilerSettings.IsReadOnlyAttributeShouldBeReplacedWithReadonlyInModifiersOnStructsParameters" xml:space="preserve">
<value>IsReadOnlyAttribute 应替为结构参数上的 "readonly"/"中的修饰符</value>
<value>IsReadOnlyAttribute 应替为结构参数上的 "readonly"/"in"中的修饰符</value>
</data>
<data name="DecompilerSettings.IsUnmanagedAttributeOnTypeParametersShouldBeReplacedWithUnmanagedConstraints" xml:space="preserve">
<value>类型参数上的IsUnmanagedAttribute 应替换为 "非托管" 约束</value>
@ -702,8 +702,8 @@ @@ -702,8 +702,8 @@
<data name="DecompilerSettings.RemoveOptionalArgumentsIfPossible" xml:space="preserve">
<value>如果可能, 删除可选参数</value>
</data>
<data name="DecompilerSettings.IntroduceLocalFunctionsNOTIMPLEMENTED" xml:space="preserve">
<value>引入本地功能 (未实现!)</value>
<data name="DecompilerSettings.IntroduceLocalFunctions" xml:space="preserve">
<value>引入本地功能 </value>
</data>
<data name="DecompilerSettings.C70LocalFunctionsAreNotImplemented" xml:space="preserve">
<value>C# 7.0 本地函数未实现!</value>

Loading…
Cancel
Save