-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #566 from icsharpcode/byref
Byref
- Loading branch information
Showing
18 changed files
with
1,010 additions
and
512 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using Microsoft.CodeAnalysis.CSharp.Syntax; | ||
|
||
namespace ICSharpCode.CodeConverter.CSharp | ||
{ | ||
internal class AdditionalAssignment : IHoistedNode | ||
{ | ||
public AdditionalAssignment(ExpressionSyntax lhs, ExpressionSyntax rhs) | ||
{ | ||
RightHandSide = rhs ?? throw new System.ArgumentNullException(nameof(rhs)); | ||
LeftHandSide = lhs ?? throw new System.ArgumentNullException(nameof(lhs)); | ||
} | ||
|
||
public ExpressionSyntax LeftHandSide { get; set; } | ||
public ExpressionSyntax RightHandSide { get; } | ||
} | ||
} |
8 changes: 5 additions & 3 deletions
8
CodeConverter/CSharp/AdditionalLocal.cs → ...Converter/CSharp/AdditionalDeclaration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,27 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using Microsoft.CodeAnalysis; | ||
using Microsoft.CodeAnalysis.CSharp; | ||
using Microsoft.CodeAnalysis.CSharp.Syntax; | ||
|
||
namespace ICSharpCode.CodeConverter.CSharp | ||
{ | ||
public class AdditionalLocal | ||
internal class AdditionalDeclaration : IHoistedNode | ||
{ | ||
public string Prefix { get; } | ||
public string Id { get; } | ||
public ExpressionSyntax Initializer { get; } | ||
public TypeSyntax Type { get; } | ||
|
||
public AdditionalLocal(string prefix, ExpressionSyntax initializer, TypeSyntax type) | ||
public AdditionalDeclaration(string prefix, ExpressionSyntax initializer, TypeSyntax type) | ||
{ | ||
Prefix = prefix; | ||
Id = $"ph{Guid.NewGuid().ToString("N")}"; | ||
Initializer = initializer; | ||
Type = type; | ||
} | ||
|
||
public IdentifierNameSyntax IdentifierName => SyntaxFactory.IdentifierName(Id).WithAdditionalAnnotations(AdditionalLocals.Annotation); | ||
public IdentifierNameSyntax IdentifierName => SyntaxFactory.IdentifierName(Id).WithAdditionalAnnotations(HoistedNodeState.Annotation); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.