atproto_sdl

Parse Lexicon SDL source into the atproto_lexicon/ast.LexiconDoc shape, and print it back, so that parse(source, id) |> result.map(print) round-trips. The NSID id is supplied by the caller, derived from the file path (see atproto_sdl/cli).

Values

pub fn main() -> Nil

gleam run -m atproto_sdl -- <src-dir> <out-dir> [--to json|sdl]: convert a directory tree of .sdl/.json files to the other format. See atproto_sdl/cli.

pub fn parse(
  source: String,
  id: String,
) -> Result(ast.LexiconDoc, error.ParseError)
pub fn parse_in_tree(
  source: String,
  id: String,
  known_docs: set.Set(String),
) -> Result(ast.LexiconDoc, error.ParseError)

Parse with workspace knowledge: known_docs are the NSIDs of the other documents compiled in the same tree. See atproto_sdl/lower.

pub fn print(doc: ast.LexiconDoc) -> String
Search Document