-
-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[.NET] Adopt c# 12 primary constructors (#272)
- Loading branch information
Showing
27 changed files
with
178 additions
and
370 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
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,9 +1,4 @@ | ||
namespace Gherkin.Ast; | ||
|
||
public class Background : StepsContainer | ||
{ | ||
public Background(Location location, string keyword, string name, string description, Step[] steps) | ||
: base(location, keyword, name, description, steps) | ||
{ | ||
} | ||
} | ||
public class Background(Location location, string keyword, string name, string description, Step[] steps) | ||
: StepsContainer(location, keyword, name, description, steps); |
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,14 +1,7 @@ | ||
namespace Gherkin.Ast; | ||
|
||
public class Comment : IHasLocation | ||
public class Comment(Location location, string text) : IHasLocation | ||
{ | ||
public Location Location { get; private set; } | ||
public string Text { get; private set; } | ||
|
||
|
||
public Comment(Location location, string text) | ||
{ | ||
Text = text; | ||
Location = location; | ||
} | ||
public Location Location { get; } = location; | ||
public string Text { get; } = text; | ||
} |
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,17 +1,9 @@ | ||
namespace Gherkin.Ast; | ||
|
||
public class DocString : StepArgument, IHasLocation | ||
public class DocString(Location location, string contentType, string content, string delimiter = null) : StepArgument, IHasLocation | ||
{ | ||
public Location Location { get; private set; } | ||
public string ContentType { get; private set; } | ||
public string Content { get; private set; } | ||
public string Delimiter { get; private set; } | ||
|
||
public DocString(Location location, string contentType, string content, string delimiter = null) | ||
{ | ||
Location = location; | ||
ContentType = contentType; | ||
Content = content; | ||
Delimiter = delimiter; | ||
} | ||
public Location Location { get; } = location; | ||
public string ContentType { get; } = contentType; | ||
public string Content { get; } = content; | ||
public string Delimiter { get; } = delimiter; | ||
} |
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
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 |
---|---|---|
@@ -1,15 +1,7 @@ | ||
using System; | ||
|
||
namespace Gherkin.Ast; | ||
|
||
public class Location | ||
public class Location(int line = 0, int column = 0) | ||
{ | ||
public int Line { get; private set; } | ||
public int Column { get; private set; } | ||
|
||
public Location(int line = 0, int column = 0) | ||
{ | ||
Line = line; | ||
Column = column; | ||
} | ||
public int Line { get; } = line; | ||
public int Column { get; } = column; | ||
} |
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
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,20 +1,11 @@ | ||
namespace Gherkin.Ast; | ||
|
||
public class Step : IHasLocation | ||
public class Step(Location location, string keyword, StepKeywordType keywordType, string text, StepArgument argument) : IHasLocation | ||
{ | ||
public Location Location { get; private set; } | ||
public string Keyword { get; private set; } | ||
public StepKeywordType KeywordType { get; } | ||
public Location Location { get; } = location; | ||
public string Keyword { get; } = keyword; | ||
public StepKeywordType KeywordType { get; } = keywordType; | ||
|
||
public string Text { get; private set; } | ||
public StepArgument Argument { get; private set; } | ||
|
||
public Step(Location location, string keyword, StepKeywordType keywordType, string text, StepArgument argument) | ||
{ | ||
Location = location; | ||
Keyword = keyword; | ||
KeywordType = keywordType; | ||
Text = text; | ||
Argument = argument; | ||
} | ||
public string Text { get; } = text; | ||
public StepArgument Argument { get; } = argument; | ||
} |
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 |
---|---|---|
@@ -1,13 +1,7 @@ | ||
namespace Gherkin.Ast; | ||
|
||
public class TableCell : IHasLocation | ||
public class TableCell(Location location, string value) : IHasLocation | ||
{ | ||
public Location Location { get; private set; } | ||
public string Value { get; private set; } | ||
|
||
public TableCell(Location location, string value) | ||
{ | ||
Location = location; | ||
Value = value; | ||
} | ||
public Location Location { get; } = location; | ||
public string Value { get; } = value; | ||
} |
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 |
---|---|---|
@@ -1,13 +1,7 @@ | ||
namespace Gherkin.Ast; | ||
|
||
public class Tag : IHasLocation | ||
public class Tag(Location location, string name) : IHasLocation | ||
{ | ||
public Location Location { get; private set; } | ||
public string Name { get; private set; } | ||
|
||
public Tag(Location location, string name) | ||
{ | ||
Name = name; | ||
Location = location; | ||
} | ||
public Location Location { get; } = location; | ||
public string Name { get; } = name; | ||
} |
Oops, something went wrong.