> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/guardrails/llms.txt.
> For full documentation content, see https://docs.nvidia.com/nemo/guardrails/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/guardrails/_mcp/server.

# nemoguardrails.colang.v1_0.lang.parser

## Module Contents

### Functions

| Name                                                                               | Description                                            |
| ---------------------------------------------------------------------------------- | ------------------------------------------------------ |
| [`_extract_flow_code`](#nemoguardrails-colang-v1_0-lang-parser-_extract_flow_code) | Helper to extract the source code for a flow.          |
| [`parse_colang_file`](#nemoguardrails-colang-v1_0-lang-parser-parse_colang_file)   | Parse the content of a .co file into the CoYML format. |

### Data

[`log`](#nemoguardrails-colang-v1_0-lang-parser-log)

### API

```python
nemoguardrails.colang.v1_0.lang.parser._extract_flow_code(
    file_content: str,
    flow_elements: typing.List[dict]
) -> typing.Optional[str]
```

Helper to extract the source code for a flow.

Currently, it uses a simple heuristic that copies all the lines between the minimum
and the maximum lines

```python
nemoguardrails.colang.v1_0.lang.parser.parse_colang_file(
    filename: str,
    content: str,
    include_source_mapping: bool = True
)
```

Parse the content of a .co file into the CoYML format.

```python
nemoguardrails.colang.v1_0.lang.parser.log = logging.getLogger(__name__)
```