add CI building .jar; parser quick'n'dirty compat with 3.8.4#9
add CI building .jar; parser quick'n'dirty compat with 3.8.4#9azrdev wants to merge 22 commits intoturanar:masterfrom
Conversation
…enerated class
found in 3.8.3 common/scripted_triggers/00_scripted_triggers.txt
found in many files on 3.8.3, e.g. files/common/pop_jobs/03_worker_jobs.txt
as found in e.g. common/component_templates/00_utilities.txt
avoid parser crash
would catch common/edicts/99_README_EDICTS.txt
as found in common/buildings/07_amenity_buildings.txt
|
A quick note on the compatibility with current versions of Stellaris (3.13.0):
To be honest, at this point I think using an actual YAML parser causes more issues than it solves considering the seeming leniency that Stellaris uses with its own parser, but that's just me dunking on the blatant YAML violations of Stellaris upstream *sigh* file.lines()
// skip the first line containing the `l_english:`
.skip(1)
// trim whitespace on each line, this means removing the indentation
.map(str::trim)
// no empty lines
.filter(|line| !line.is_empty())
// filter comments
.filter(|line| line.chars().next().unwrap() != '#')
.map(|line| {
// everything before the first colon, may need to be changed so spaces depending on how `menace_name:1 "value"` is *supposed* to be parsed
let key = line.split_once(':')?.0;
// everything after the first space
let raw_value = line.split_once(' ')?.1
// replace all the unknown escape sequences with question marks (i.e. \T becomes \u003f), see below for more info
.replace({ let mut is_escape = false; move |ch| { if is_escape { is_escape = false; !['t', 'n', '"', '\\'].contains(&ch) } else { is_escape = ch == '\\'; false } }, "u003f");
// actually parse YAML from the rvalue, this one seems mostly fine, it's just the format of the file that's off, not the escaped strings, *mostly*
let value = yaml_parse(raw_value);
(key, value)
})This would fix the first four issues in the list, leaving only the latter three open, but those need actual code/parser fixes. The following is a grep'd list of escape characters used (non-overlapping matches, which means grep -hP '^\s*[^ #]' /path/to/steamapps/common/Stellaris/localisation/**/*.yml | grep -Po '\\.' | sort | uniq -c | sort -n
So that shouldn't be much of a problem, it's just that one file that's broken it seems, however who knows what the future holds when this one slipped through.
I mean.… localisation/english/nemesis_crisis_l_english.yml actually chokes yq-go on that line: Anyway, hope this here helps anyone down the line. Edit: Small bonus, if you could also bump the spring boot dependency to 2.1.18 (i.e. the last 2.1.x release) that'd be cool, since my local build system requires a fix for an upstream bug and bumping to 2.1.18 seems to work without a hitch. |
the result is at least a usable tech tree: https://azrdev.github.io/stellaris-tech-tree/3.8.4-gemini/