diff --git a/Program.cs b/Program.cs index 5c65f8a..376ed78 100644 --- a/Program.cs +++ b/Program.cs @@ -69,7 +69,7 @@ class Program } } -enum TokenType +public enum TokenType { LParen, RParen, LBrace, RBrace, @@ -107,26 +107,7 @@ enum TokenType EOF } -class Token -{ - public readonly TokenType type; - public readonly String lexeme; - public readonly Object? literal; - public readonly int line; - - public Token(TokenType type, String lexeme, Object? literal, int line) - { - this.type = type; - this.lexeme = lexeme; - this.literal = literal; - this.line = line; - } - - public override string ToString() - { - return $"{type} {lexeme} {literal}"; - } -} +public record Token(TokenType type, String lexeme, Object? literal, int line); class Scanner {