eliasdoehne / stellaris-dashboard

A graph dashboard and event log for Stellaris.
122 stars 14 forks source link

Fails to parse attached LOTOR save #118

Closed MichaelMakesGames closed 8 months ago

MichaelMakesGames commented 8 months ago

Attached is a save using the Star Wars: Legacy of the Old Republic mod. Parsing fails. It looks like this is the token causing the issue y'toub_esyam (used as a key in a map).

@eliasdoehne what do think about switching

fn _is_valid_unquoted_str_char(c: char) -> bool {
    c.is_ascii_alphanumeric() || c == '_' || c == ':' || c == '.' || c == '@'
}

from an allowlist to a denylist? Accept anything that isn't whitespace or ={}<>[]#$|? (For just parsing saves, I think only ={} would be sufficient, but <>[]#$| are used in the game files, so those would just be some future proofing for if you ever use the parser for reading game files like mentioned here https://github.com/eliasdoehne/stellaris-dashboard/issues/114#issuecomment-1800350144)

autosave_2291.01.01.zip

eliasdoehne commented 8 months ago

Sounds good! As long as it stays compatible with unmodded Stellaris saves, we can change the parser as needed. I also agree about restricting the other characters.