zbraniecki/l20n — Issue #12: Compiler shouldn't assume that entities with an index are hashes 
Author: stasm
Created: 2012-02-03 17:02:05+00:00
State: open

Example:

The above l20n is compiled like so:

this.happy = let (x = {"one": {"first": "I", "second": "You", "third": {"male": "He", "female": "She", "impersonal": "It"}}, "many": {"first": "We", "second": "You", "third": "They"}}) function (env, sys, index) {
if (index !== undefined)
return x;
return x[sys.getmacro(env, sys, "plural", [sys.getent(env, sys, "user", ["number"])])][sys.getent(env, sys, "user", ["person"])][sys.getent(env, sys, "user", ["gender"])];
};

The `[sys.getent(env, sys, "user", ["gender"])]` index (scroll to the right to see it) will always try to find a matching hash member, even if the object preceding it is not a hash.