Here is a working version of the input side as well. It now has methods to export and import the Layout globals as well, and on import it compares the original with the imported version of the global. The export and import distinguish between string and non-string types in a $List, which is necessary for a faithful round-trip.
I also ran into an issue where the JS output encoding erroneously escapes $C(11) as \v. According to RFC 4627 it should not.
However in order to successfully round-trip I had to add \v unescaping in the parser.
I'm not sure I've covered every possible round trip issue but it works for the Layout globals now.
The class that contains all the import and export methods is in the attached zip file. This is a rough cut but working.
Ted
- Log in to post comments