- return 0;
- unsigned lineCount = unlinkedExecutable->lineCount();
- unsigned firstLine = source.firstLine() + unlinkedExecutable->firstLineOffset();
- unsigned startOffset = source.startOffset() + unlinkedExecutable->startOffset();
-
- // We don't have any owner executable. The source string is effectively like a global
- // string (like in the handling of eval). Hence, the startColumn is always 1.
- unsigned startColumn = 1;
- unsigned sourceLength = unlinkedExecutable->sourceLength();
- bool endColumnIsOnStartLine = !lineCount;
- // The unlinkedBodyEndColumn is based-0. Hence, we need to add 1 to it. But if the
- // endColumn is on the startLine, then we need to subtract back the adjustment for
- // the open brace resulting in an adjustment of 0.
- unsigned endColumnExcludingBraces = unlinkedExecutable->unlinkedBodyEndColumn() + (endColumnIsOnStartLine ? 0 : 1);
- unsigned startOffsetExcludingOpenBrace = startOffset + 1;
- unsigned endOffsetExcludingCloseBrace = startOffset + sourceLength - 1;
- SourceCode bodySource(source.provider(), startOffsetExcludingOpenBrace, endOffsetExcludingCloseBrace, firstLine, startColumn);