clarified signature: prefer enum types;
authorwenzelm
Tue, 29 Aug 2023 17:19:19 +0200
changeset 78609 67492b2a3a62
parent 78608 0e01c3b55b63
child 78610 fd1fec53665b
clarified signature: prefer enum types;
src/Pure/General/toml.scala
--- a/src/Pure/General/toml.scala	Tue Aug 29 17:17:12 2023 +0200
+++ b/src/Pure/General/toml.scala	Tue Aug 29 17:19:19 2023 +0200
@@ -133,11 +133,9 @@
 
   /* lexer */
 
-  object Kind extends Enumeration {
-    val KEYWORD, VALUE, STRING, MULTILINE_STRING, LINE_SEP, ERROR = Value
-  }
+  enum Kind { case KEYWORD, VALUE, STRING, MULTILINE_STRING, LINE_SEP, ERROR }
 
-  sealed case class Token(kind: Kind.Value, text: Str) {
+  sealed case class Token(kind: Kind, text: Str) {
     def is_keyword(name: Str): Bool = kind == Kind.KEYWORD && text == name
     def is_value: Bool = kind == Kind.VALUE
     def is_string: Bool = kind == Kind.STRING