-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
28 additions
and
32 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
4 changes: 2 additions & 2 deletions
4
src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypes/EndOfProgramType.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,6 +1,6 @@ | ||
namespace HydraScript.Domain.FrontEnd.Lexer.TokenTypes; | ||
|
||
internal record EndOfProgramType() : TokenType("EOP", "", int.MaxValue - 1) | ||
internal record EndOfProgramType() : TokenType(EopTag) | ||
{ | ||
public override bool EndOfProgram() => true; | ||
public const string EopTag = "EOP"; | ||
} |
2 changes: 1 addition & 1 deletion
2
src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypes/ErrorType.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,6 +1,6 @@ | ||
namespace HydraScript.Domain.FrontEnd.Lexer.TokenTypes; | ||
|
||
internal record ErrorType() : TokenType("ERROR", @"\S+", int.MaxValue) | ||
internal record ErrorType() : TokenType("ERROR") | ||
{ | ||
public override bool Error() => true; | ||
} |
3 changes: 1 addition & 2 deletions
3
src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypes/IgnorableType.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,7 +1,6 @@ | ||
namespace HydraScript.Domain.FrontEnd.Lexer.TokenTypes; | ||
|
||
public record IgnorableType(string Tag, string Pattern, int Priority) | ||
: TokenType(Tag, Pattern, Priority) | ||
public record IgnorableType(string Tag) : TokenType(Tag) | ||
{ | ||
public override bool CanIgnore() => true; | ||
} |
8 changes: 2 additions & 6 deletions
8
src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypes/TokenType.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,14 +1,10 @@ | ||
namespace HydraScript.Domain.FrontEnd.Lexer.TokenTypes; | ||
|
||
public record TokenType(string Tag, string Pattern, int Priority) | ||
public record TokenType(string Tag) | ||
{ | ||
public virtual bool CanIgnore() => false; | ||
|
||
public virtual bool EndOfProgram() => false; | ||
|
||
public virtual bool Error() => false; | ||
|
||
public string GetNamedRegex() => $"(?<{Tag}>{Pattern})"; | ||
|
||
public override string ToString() => Tag; | ||
public sealed override string ToString() => Tag; | ||
} |
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