> For the complete documentation index, see [llms.txt](https://docs.yarnspinner.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yarnspinner.dev/api/csharp/yarn.compiler/yarn.compiler.utility/yarn.compiler.utility.parsesource.md).

# ParseSource(string)

Method in [Utility](/api/csharp/yarn.compiler/yarn.compiler.utility.md)

## Summary

Parses a string of Yarn source code, and produces a FileParseResult and (if there were any problems) a collection of diagnostics.

```csharp
public static (FileParseResult, IEnumerable<Diagnostic>) ParseSource(string source)
```

## Parameters

| Name            | Description               |
| --------------- | ------------------------- |
| `string` source | The source code to parse. |

## Returns

A tuple containing a [FileParseResult](/api/csharp/yarn.compiler/yarn.compiler.fileparseresult.md) that stores the parse tree and tokens, and a collection of [Diagnostic](/api/csharp/yarn.compiler/yarn.compiler.diagnostic.md) objects that describe problems in the source code.
