apiCallScope.enter();
try {
// Seed the scoped parameters.
apiCallScope.seed(SoyJsSrcOptions.class, jsSrcOptions);
apiCallScope.seed(Key.get(Boolean.class, IsUsingIjData.class), isUsingIjData);
BidiGlobalDir bidiGlobalDir = SoyBidiUtils.decodeBidiGlobalDirFromOptions(
jsSrcOptions.getBidiGlobalDir(),
jsSrcOptions.getUseGoogIsRtlForBidiGlobalDir());
ApiCallScopeUtils.seedSharedParams(apiCallScope, msgBundle, bidiGlobalDir);
// Replace MsgNodes.
if (jsSrcOptions.shouldGenerateGoogMsgDefs()) {
replaceMsgsWithGoogMsgsVisitorProvider.get().exec(soyTree);
(new MoveGoogMsgNodesEarlierVisitor()).exec(soyTree);
Preconditions.checkState(
bidiGlobalDir != null,
"If enabling shouldGenerateGoogMsgDefs, must also set bidi global directionality.");
} else {
Preconditions.checkState(
bidiGlobalDir == null || bidiGlobalDir.isStaticValue(),
"If using bidiGlobalIsRtlCodeSnippet, must also enable shouldGenerateGoogMsgDefs.");
try {
(new InsertMsgsVisitor(msgBundle, false)).exec(soyTree);
} catch (EncounteredPlrselMsgException e) {
throw SoySyntaxExceptionUtils.createWithNode(