You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! Im encountering a strange error, and after about an hour of attempting to fix it, have gotten nowhere. The code im running is below aswell as the entire error message. This issue also happens with decodeWithDefaults.
val tomlMapper = tomlMapper {}
val tomlFile =File(Bukkit.getServer().pluginManager.getPlugin("DawnPlugin").dataFolder, "config.toml")
if(!tomlFile.exists()) {
tomlFile.createNewFile()
}
val tomlFilePath = tomlFile.absolutePath
tomlMapper.decode<Config>(tomlFilePath)
println(config)
//CONFIG CLASSdata classConfig(
valmessages:Messages,
) {
data classMessages(valjoinMessage:String, valleaveMessage:String, valchatFormat:String)
}
val defaultConfig =Config(
messages =Config.Messages(
joinMessage ="<green>[+] %playerName%",
leaveMessage ="<red>[-] %playerName%",
chatFormat ="%displayName% : %message%"
)
)
using this produces the error message below:
cc.ekblad.toml.model.TomlException$ParseError: toml parse error, on line 1: token recognition error at: ':'
at cc.ekblad.toml.serialization.TomlErrorListener.syntaxError(TomlErrorListener.kt:21) ~[?:?]
at org.antlr.v4.runtime.ProxyErrorListener.syntaxError(ProxyErrorListener.java:41) ~[?:?]
at org.antlr.v4.runtime.Lexer.notifyListeners(Lexer.java:364) ~[?:?]
at org.antlr.v4.runtime.Lexer.nextToken(Lexer.java:144) ~[?:?]
at org.antlr.v4.runtime.BufferedTokenStream.fetch(BufferedTokenStream.java:169) ~[?:?]
at org.antlr.v4.runtime.BufferedTokenStream.sync(BufferedTokenStream.java:152) ~[?:?]
at org.antlr.v4.runtime.BufferedTokenStream.consume(BufferedTokenStream.java:136) ~[?:?]
at org.antlr.v4.runtime.atn.ParserATNSimulator.execATN(ParserATNSimulator.java:537) ~[?:?]
at org.antlr.v4.runtime.atn.ParserATNSimulator.adaptivePredict(ParserATNSimulator.java:393) ~[?:?]
at cc.ekblad.toml.parser.TomlParser.key(TomlParser.java:378) ~[?:?]
at cc.ekblad.toml.parser.TomlParser.key_value(TomlParser.java:333) ~[?:?]
at cc.ekblad.toml.parser.TomlParser.expression(TomlParser.java:221) ~[?:?]
at cc.ekblad.toml.parser.TomlParser.document(TomlParser.java:143) ~[?:?]
at cc.ekblad.toml.serialization.TomlDeserializerKt.from(TomlDeserializer.kt:49) ~[?:?]
at cc.ekblad.toml.serialization.TomlDeserializerKt.from(TomlDeserializer.kt:20) ~[?:?]
at me.ders.Main.onEnable(Main.kt:59) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) ~[spigot-1.8.9.jar:git-Spigot-21fe707-741a1bd]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:340) [spigot-1.8.9.jar:git-Spigot-21fe707-741a1bd]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405) [spigot-1.8.9.jar:git-Spigot-21fe707-741a1bd]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin(CraftServer.java:357) [spigot-1.8.9.jar:git-Spigot-21fe707-741a1bd]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins(CraftServer.java:317) [spigot-1.8.9.jar:git-Spigot-21fe707-741a1bd]
at net.minecraft.server.v1_8_R3.MinecraftServer.s(MinecraftServer.java:414) [spigot-1.8.9.jar:git-Spigot-21fe707-741a1bd]
at net.minecraft.server.v1_8_R3.MinecraftServer.k(MinecraftServer.java:378) [spigot-1.8.9.jar:git-Spigot-21fe707-741a1bd]
at net.minecraft.server.v1_8_R3.MinecraftServer.a(MinecraftServer.java:333) [spigot-1.8.9.jar:git-Spigot-21fe707-741a1bd]
at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:263) [spigot-1.8.9.jar:git-Spigot-21fe707-741a1bd]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:525) [spigot-1.8.9.jar:git-Spigot-21fe707-741a1bd]
at java.lang.Thread.run(Thread.java:750) [?:1.8.0_352]
Caused by: org.antlr.v4.runtime.LexerNoViableAltException
at org.antlr.v4.runtime.atn.LexerATNSimulator.failOrAccept(LexerATNSimulator.java:309) ~[?:?]
at org.antlr.v4.runtime.atn.LexerATNSimulator.execATN(LexerATNSimulator.java:230) ~[?:?]
at org.antlr.v4.runtime.atn.LexerATNSimulator.match(LexerATNSimulator.java:114) ~[?:?]
at org.antlr.v4.runtime.Lexer.nextToken(Lexer.java:141) ~[?:?]
... 23 more
That file does indeed look like it should be valid. I'll add it as a test case to the remove-antlr-dependency branch, which rewrites the parser entirely. I guess this is as good a reason as any to go ahead and release it.
Hello! Im encountering a strange error, and after about an hour of attempting to fix it, have gotten nowhere. The code im running is below aswell as the entire error message. This issue also happens with decodeWithDefaults.
using this produces the error message below:
The text was updated successfully, but these errors were encountered: