-
Notifications
You must be signed in to change notification settings - Fork 5
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
[methods aliases] Features for Function Type and load function as argument #250
Changes from all commits
b67dd2d
5ebac5a
6e2f30a
478b673
4de0ab0
311f8af
1c9cce1
c1fc50e
594cd24
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,19 @@ | ||
namespace vein.syntax | ||
{ | ||
using System.Collections.Generic; | ||
using Sprache; | ||
namespace vein.syntax; | ||
|
||
public class ReturnStatementSyntax : StatementSyntax, IPositionAware<ReturnStatementSyntax> | ||
{ | ||
public ReturnStatementSyntax(ExpressionSyntax e) => Expression = e; | ||
public override SyntaxType Kind => SyntaxType.ReturnStatement; | ||
using System.Collections.Generic; | ||
using Sprache; | ||
|
||
public override IEnumerable<BaseSyntax> ChildNodes => GetNodes(Expression); | ||
public class ReturnStatementSyntax(ExpressionSyntax e) : StatementSyntax, IPositionAware<ReturnStatementSyntax> | ||
{ | ||
public override SyntaxType Kind => SyntaxType.ReturnStatement; | ||
|
||
public ExpressionSyntax Expression { get; set; } | ||
public override IEnumerable<BaseSyntax> ChildNodes => GetNodes(Expression); | ||
|
||
public new ReturnStatementSyntax SetPos(Position startPos, int length) | ||
{ | ||
base.SetPos(startPos, length); | ||
return this; | ||
} | ||
public ExpressionSyntax Expression { get; set; } = e; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Initialize properties in the constructor. It's better to initialize the - public ExpressionSyntax Expression { get; set; } = e;
+ public ExpressionSyntax Expression { get; set; }
+ public ReturnStatementSyntax(ExpressionSyntax e)
+ {
+ Expression = e;
+ }
|
||
public new ReturnStatementSyntax SetPos(Position startPos, int length) | ||
{ | ||
base.SetPos(startPos, length); | ||
return this; | ||
} | ||
Comment on lines
+14
to
+17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid using the Using the - public new ReturnStatementSyntax SetPos(Position startPos, int length)
+ public ReturnStatementSyntax SetPosition(Position startPos, int length)
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider initializing
OwnerClass
in the constructor.To ensure
OwnerClass
is always set correctly, consider initializing it in the constructor.Committable suggestion