Skip to content

Commit d5369d5

Browse files
Update FenParser.kt
1 parent b063711 commit d5369d5

File tree

1 file changed

+6
-24
lines changed
  • lib/chesskt/src/commonMain/kotlin/com/krossovochkin/chesskt/fen

1 file changed

+6
-24
lines changed

lib/chesskt/src/commonMain/kotlin/com/krossovochkin/chesskt/fen/FenParser.kt

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -64,21 +64,15 @@ internal object FenParser {
6464
file += c.digitToInt()
6565
}
6666
c == ' ' -> state++
67-
else -> {
68-
println("Unknown char '$c' on state '$state'")
69-
return null
70-
}
67+
else -> return null
7168
}
7269
}
7370
1 -> {
7471
when (c) {
7572
'w' -> isWhiteTurn = true
7673
'b' -> isWhiteTurn = false
7774
' ' -> state++
78-
else -> {
79-
println("Unknown char '$c' on state '$state'")
80-
return null
81-
}
75+
else -> return null
8276
}
8377
}
8478
2 -> {
@@ -89,10 +83,7 @@ internal object FenParser {
8983
'q' -> isBlackQueenCastleAvailable = true
9084
'-' -> Unit
9185
' ' -> state++
92-
else -> {
93-
println("Unknown char '$c' on state '$state'")
94-
return null
95-
}
86+
else -> return null
9687
}
9788
}
9889
3 -> {
@@ -110,10 +101,7 @@ internal object FenParser {
110101
}
111102
state++
112103
}
113-
else -> {
114-
println("Unknown char '$c' on state '$state'")
115-
return null
116-
}
104+
else -> return null
117105
}
118106
}
119107
4 -> {
@@ -126,10 +114,7 @@ internal object FenParser {
126114
}
127115
}
128116
' ' -> state++
129-
else -> {
130-
println("Unknown char '$c' on state '$state'")
131-
return null
132-
}
117+
else -> return null
133118
}
134119
}
135120
5 -> {
@@ -142,10 +127,7 @@ internal object FenParser {
142127
}
143128
}
144129
' ' -> state++
145-
else -> {
146-
println("Unknown char '$c' on state '$state'")
147-
return null
148-
}
130+
else -> return null
149131
}
150132
}
151133
6 -> {

0 commit comments

Comments
 (0)