An update on the parser front.

I've ended up developing two JS parser versions:

1) Compatibility parser, which produces exactly the same AST as the current 
properties parser. This one will land in the current l10n.js

https://github.com/zbraniecki/l20n.js/blob/1027684-add-subset-of-l20n-format/src/lib/format/l20n/parser.js

2) V3 parser, intended to land together with v3 API and new revision of l10n.js

https://github.com/zbraniecki/l20n.js/blob/v3-features/src/lib/format/l20n/parser.js

The latter one supports:
 - default hash values
 - simplified CallExpressions
 - separation between variables, globals and identifiers

That means it covers 4 out of 5 scenarios we are planning for V3. The only one 
I left intentionally out is the triple-quote strings. We don't need them now, 
they may impact performance and add a bit of complexity, while they don't 
affect AST at all. So I decided to leave this one out for now.

The latter also uses different AST than what we currently have, so it will be 
incompatible with v2 of our resolver.

I want to use the v3 version of the parser as a reference point for python 
ports and any work based on L20n, and the v2 compatibility one exclusively for 
the runtime.

I will update my port and will work with Stas to get the v3 version merged into 
his v3 API work.

I believe that v3 should only support l20n file format and if needed we may 
write a properties parser that will produce the v3 AST for compatibility 
reasons.

If you are working on any code that needs l20n file format parser, it should be 
based on v3 version. I'll update this thread with the python port when it's 
ready.

zb.
_______________________________________________
tools-l10n mailing list
[email protected]
https://lists.mozilla.org/listinfo/tools-l10n

Reply via email to