# `Typsty.SyntaxError`
[🔗](https://github.com/akoutmos/typsty/blob/0.1.0/lib/typsty/syntax_error.ex#L1)

A template has invalid Typst syntax, or a component breaks the rules for components (see
`Typsty.Component`). Raised when a module with a `~TYPST` sigil or a `.typ` template is
compiled (or a component, with the `.typ` files in its folder), so that the problem fails
the build instead of a render, and when `mix format` formats one with `Typsty.Formatter`.

`:diagnostics` has every problem in the template, and `:file`, `:line` and `:column` point
at the first one. `:kind` is `:syntax` for syntax errors, and `:component` for breaking
the rules for components: content at their top level, reading `sys.inputs`, or reading a
file they don't have.

# `t`

```elixir
@type t() :: %Typsty.SyntaxError{
  __exception__: term(),
  column: pos_integer() | nil,
  diagnostics: [Typsty.Diagnostic.t()],
  file: String.t() | nil,
  kind: :syntax | :component,
  line: pos_integer() | nil,
  snippet: String.t() | nil
}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
