docs: public static ImmutableMap<String, PrimitiveData> parseCompileTimeGlobals(CharSource inputSource)
        throws IOException {
      Builder<String, PrimitiveData> compileTimeGlobalsBuilder = ImmutableMap.builder();
      ErrorReporter errorReporter = ErrorReporter.exploding();
  
      try (BufferedReader reader = inputSource.openBufferedStream()) {
        int lineNum = 1;
        for (String line = reader.readLine(); line != null; line = reader.readLine(), ++lineNum) {
  
          if (line.startsWith("//") || line.trim().length() == 0) {
            continue;
          }
  
          SourceLocation sourceLocation = new SourceLocation("globals", lineNum, 1, lineNum, 1);
  
          Matcher matcher = COMPILE_TIME_GLOBAL_LINE.matcher(line);
          if (!matcher.matches()) {
            errorReporter.report(sourceLocation, INVALID_FORMAT, line);
            continue;
          }
          String name = matcher.group(1);
          String valueText = matcher.group(2).trim();
  
          ExprNode valueExpr = SoyFileParser.parseExprOrDie(valueText);
  
          // Record error for non-primitives.
          // TODO: Consider allowing non-primitives (e.g. list/map literals).
          if (!(valueExpr instanceof PrimitiveNode)) {
            if (valueExpr instanceof GlobalNode || valueExpr instanceof VarRefNode) {
              errorReporter.report(sourceLocation, INVALID_VALUE, valueExpr.toSourceString());
            } else {
              errorReporter.report(sourceLocation, NON_PRIMITIVE_VALUE, valueExpr.toSourceString());
            }
            continue;
          }
  
          // Default case.
          compileTimeGlobalsBuilder.put(
              name, InternalValueUtils.convertPrimitiveExprToData((PrimitiveNode) valueExpr));
        }
      }
      return compileTimeGlobalsBuilder.build();
    }