nickbabcock / jomini

Parses Paradox files into javascript objects
MIT License
78 stars 9 forks source link

Strings containing numbers become numbers #98

Closed Clashsoft closed 1 year ago

Clashsoft commented 1 year ago

This part of a Stellaris custom empire file:

        name={
            full_names={
                key="01"
            }
        }

Is parsed as:

      "name": {
        "full_names": {
          "key": 1
        }
      },

This is problematic, because it makes it hard to round-trip convert the JSON back to text. Especially because the leading 0 is dropped.

I propose parsing quoted numbers as strings and not numbers.

nickbabcock commented 1 year ago

I think this is a good idea. Let me see what I can do