Cholmondely wrote: ↑Mon Mar 13, 2023 5:15 pm
Al I get from the AppleMac's plutil is gubbins/Oolite/AddOns/oolite.oxp.Killer Wolf.hathor_station.oxp/Config/shipdata.plist: Unexpected character { at line 1
I have been ogling braces, staring at semi-colons and peeking at commas - and am utterly fed up.
Yes, that can happen with unfortunate syntax and without tools providing good error messages. I'd not even try looking for the issue manually/optically. Have you tried using my parser?
Cholmondely wrote: ↑Mon Mar 13, 2023 5:15 pm
All I can find on the subject is this:
The round brackets are arrays in OpenStep, and are used to group information for a given key. Examples are the exhaust (if one has multiple ones for a given ship), the individual custom views and sub-entities...
The curly brackets make up dictionaries, which tie together different keys on the same subject. The two main examples there are the overall entries themselves (each ship is made up of a dictionary of keys describing it) and the external views (a dictionary of individual views, each of which is defined as an array of keys describing that given view). (Thargoid 2011)
Nothing about when one uses a comma or a semi-colon - and since I don't even comprehend the difference between a dictionary and an array, I am floundering and feeling frustrated!
So to shed some light here:
In a dictionary, every value has a name. To markup a dictionary you need to use curly braces, and it would look like this:
{
"name1" = "value1";
"name2" = "value2";
}
Not all names have to go into quotes, and not all values require them. But you now need to watch out where you place them and where not.
Note that after every key/value pair there is a semicolon.
For arrays, you have several values without name, and they are grouped using round brackets:
(
value1,
value2,
value3
)
Later the values are just accessed by numbers: The first, the second, the next, the last, ...
Note that between two values there is a comma.
Now the part that can make plist files really complex:
Wherever you place a value, it can be a primitive one (a number, a string, a boolean value like true/false) or a complex value such as an array or a dictionary. And with this you can create all the complex structures you perceive when looking at Oolite's plist files.
There is some stuff written on Wikipedia, but a more precise definition is required for parsers:
https://en.wikipedia.org/wiki/Property_list
So again: Try to run parsers/linters - but those that give good error messages. The example you gave is not really helping.
If you are out of suitable software, try the PList tester contained in
https://github.com/HiranChaudhuri/OoliteAddonScanner