[fpc-devel] Public access of FPC features and settings
Michael Van Canneyt
michael at freepascal.org
Tue Mar 9 23:41:48 CET 2021
On Tue, 9 Mar 2021, Michael Van Canneyt via fpc-devel wrote:
>
>
> On Tue, 9 Mar 2021, Florian Klämpfl via fpc-devel wrote:
>
>>> Since we write the resource strings in JSON, and XML is meanwhile all but
>>> replaced by JSON, I think it would be much better to write JSON ?
>>>
>>
>> The compiler writes the node tree already as XML, so I thought XML might be
>> the better choice?
>
> The node tree is not for public use. The resource string files are, and this
> is too...
>
>> Despite the fact that I really dislike json for two reasons: it reminds me
>> of JS and C; ad hoc writing is annoying due to the comma being a separator
>> and no trailing commas after the last value being allowed.
>
> Well, then it means pas2js will unfortunately not follow FPC in this; if
> anything it will write JSON, because it already writes everything else in
> JSON.
Just to show this is not an exaggerated statement,
pas2js can also output the compiler messages itself as JSON for easier
treatment:
{ "message" : "Using unit path: \"/Users/michael/pas2js/packages/rtl\"", "line" : 0, "col" : 0, "number" : 104, "filename" : "", "type" : "Info" }
{ "message" : "Output file: \"\"", "line" : 0, "col" : 0, "number" : 106, "filename" : "", "type" : "Info" }
{ "message" : "Fatal: parameter a.pp: Pascal file not found: \"/Volumes/Development/michael/a.pp\"", "line" : 0, "col" : 0, "number" : 0, "filename" : "", "type" : "Info" }
(I believe the TMS Web core compiler uses this format to convert it to a
delphi-understandable format))
Michael.
More information about the fpc-devel
mailing list