private void parseBracedArgument(int pendingTextStart) {
            // Track the starting position of the interpolation (here minus the opening '$').
            int startPosition = parser.position() - 1;
            int startLine = parser.line();
            int startColumn = parser.column() - 2;
            boolean stripLeading = false;

            parser.expect('{');

            // Strip leading whitespace if "~" comes at the start of a template expression. This is handled by faking
            // that the start position of the expression is the stripped whitespace position. Note that once stripped,
            // things like columns and lines become detached from the actual source text. This only matters for inline
            // block alignment, and as such is forbidden to be used with it.
            if (parser.peek() == '~') {
                stripLeading = true;
                parser.skip();
                if (pendingTextStart > -1) {
                    while (startPosition > pendingTextStart
                            && Character.isWhitespace(parser.input().charAt(startPosition - 1))) {
                        startPosition--;
                    }
                }
            }

            if (parser.peek() == '?' || parser.peek() == '^' || parser.peek() == '#') {
                pushBlock(pendingTextStart, startPosition, startLine, startColumn, parser.peek());
                return;
            }

            if (parser.peek() == '/') {
                popBlock(pendingTextStart, startPosition, startColumn);
                return;
            }

            // Output any pending captured text before the output of the expression.
            if (pendingTextStart > -1) {
                pushOperation(Operation.stringSlice(parser.input(), pendingTextStart, startPosition));
            }

            Operation operation = parseNormalArgument();

            if (parser.peek() == '@') {
                parser.skip();
                int start = parser.position();
                parser.consumeWhile(this::isNameCharacter);
                String sectionName = parser.sliceFrom(start);
                ensureNameIsValid(sectionName);
                operation = Operation.inlineSection(sectionName, operation);
            }

            if (parser.peek() == '|') {
                // Note: inline block alignment doesn't work with `?`, `^`, and `#`, so just checking here is fine.
                if (stripLeading) {
                    throw error("Cannot strip leading whitespace with '~' when using inline block alignment '|'");
                }
                String staticWhitespace = isAllLeadingWhitespaceOnLine(startPosition, startColumn)
                        ? template.substring(startPosition - startColumn, startPosition)
                        : null;
                parser.expect('|');
                operation = Operation.block(operation, staticWhitespace);
            }

            boolean skipTrailingWs = parseStripTrailingWhitespace();
            parser.expect('}');
            pushOperation(operation);

            if (skipTrailingWs) {
                skipTrailingWhitespaceInParser();
            }
        }
A BlockOperation that repeats a template for each value referenced by the block. Each iteration pushes
a state to the writer that includes key, value, key.first, and key.last context properties. The name
of the context property can be customized in the template.
smithy-utils/src/main/java/software/amazon/smithy/utils/CodeFormatter.java