> For the complete documentation index, see [llms.txt](https://docs.internetobject.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.internetobject.org/structure-and-syntax/syntax-errors.md).

# Syntax Errors

A **syntax error** is a problem in the *shape* of the text — an unbalanced brace, a missing comma, an unterminated string — detected while tokenizing or parsing, before any schema validation. (Errors about *values* — wrong type, out of range — are validation errors; see [Error Model](/parsing-and-errors/error-model.md).)

## Common syntax errors

### Unbalanced brackets

```ruby
pt: { object, schema: { x: int } }
---
{ 1                      # ✗ expecting-bracket  (the '{' is never closed)
```

The unterminated `{` raises `expecting-bracket`.

### Missing comma

Values must be comma-separated. Without commas, several tokens merge into one open string:

```ruby
~ 101 Thomas 25      # one value "101 Thomas 25", not three
```

### Unterminated string

A quoted string with no closing quote raises a tokenizer error:

```ruby
~ "John Doe          # missing closing quote
```

## Recovery is bounded by structure

On a syntax error the parser **skips ahead to the next boundary** — a record separator `~` or a section separator `---` (or end of file) — records the error, and resumes. So one malformed record does not prevent later records from being parsed. See [Parser Behavior & Recovery](/parsing-and-errors/parser-behavior.md).

## See Also

* [Error Model](/parsing-and-errors/error-model.md)
* [Parser Behavior & Recovery](/parsing-and-errors/parser-behavior.md)
* [Comments](/structure-and-syntax/comments.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.internetobject.org/structure-and-syntax/syntax-errors.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
