Given an interpolation, find all of its chunks, validate that they are only
simple variable substitutions or else Intl.plural/gender calls,
and keep track of the pieces of text so that other parts
of the program can deal with the simple string sections and the generated
parts separately. Note that this is a SimpleAstVisitor, so it only
traverses one level of children rather than automatically recursing. If we
find a plural or gender, which requires recursion, we do it with a separate
This visits the program source nodes looking for Intl.message uses
that conform to its pattern and then creating the corresponding
IntlMessage objects. We have to find both the enclosing function, and
the Intl.message invocation.
A visitor to extract information from Intl.plural/gender sends. Note that
this is a SimpleAstVisitor, so it doesn't automatically recurse. So this
needs to be called where we expect a plural or gender immediately below.