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
/// <summary> /// <summary>
/// Determines whether storeInst.Variable is only assigned once and used only inside <paramref name="usingContainer"/>. /// 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.) /// (This only applies to value types.)
/// </summary> /// </summary>
bool VariableIsOnlyUsedInBlock(StLoc storeInst, BlockContainer usingContainer) bool VariableIsOnlyUsedInBlock(StLoc storeInst, BlockContainer usingContainer)

11
ICSharpCode.Decompiler/DecompilerSettings.cs

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

6
ILSpy/Properties/Resources.Designer.cs generated

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

4
ILSpy/Properties/Resources.resx

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

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

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

Loading…
Cancel
Save