{"id":52149982,"url":"https://github.com/yaml/yamlstar-delphi","last_synced_at":"2026-08-06T19:00:53.637Z","repository":{"id":374983667,"uuid":"1143730475","full_name":"yaml/yamlstar-delphi","owner":"yaml","description":null,"archived":false,"fork":false,"pushed_at":"2026-07-29T02:30:11.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-08-06T10:43:52.834Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Pascal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yaml.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"claude":null,"gemini":null,"cursor":null,"copilot":null,"dco":null,"cla":null,"disclosure":null}},"created_at":"2026-01-27T23:27:16.000Z","updated_at":"2026-07-29T02:30:17.000Z","dependencies_parsed_at":"2026-08-06T10:53:59.672Z","dependency_job_id":null,"html_url":"https://github.com/yaml/yamlstar-delphi","commit_stats":null,"previous_names":["yaml/yamlstar-delphi"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/yaml/yamlstar-delphi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaml%2Fyamlstar-delphi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaml%2Fyamlstar-delphi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaml%2Fyamlstar-delphi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaml%2Fyamlstar-delphi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yaml","download_url":"https://codeload.github.com/yaml/yamlstar-delphi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaml%2Fyamlstar-delphi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":36345931,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-08-06T04:43:03.162Z","status":"ssl_error","status_checked_at":"2026-08-06T04:43:02.660Z","response_time":54,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-08-06T19:00:46.023Z","updated_at":"2026-08-06T19:00:53.631Z","avatar_url":"https://github.com/yaml.png","language":"Pascal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# YAMLStar Delphi/Pascal Bindings\n\nDelphi/Pascal bindings for YAMLStar - a pure YAML 1.2 loader implemented in\nClojure.\n\n## Features\n\n- **YAML 1.2 Spec Compliance**: 100% compliant with YAML 1.2 core schema\n- **Pure Implementation**: No dependencies on external YAML parsers\n- **Fast Native Performance**: Uses GraalVM native-image shared library\n- **Simple API**: Load YAML documents with a single method call\n- **Multi-Document Support**: Load multiple YAML documents from a single string\n- **Free Pascal Compatible**: Works with Free Pascal Compiler (FPC)\n\n## Installation\n\n### Prerequisites\n\nFirst, build and install the shared library:\n\n```bash\ncd ../libyamlstar\nmake native\nsudo make install PREFIX=/usr/local\n```\n\nOr install to user-local directory:\n\n```bash\ncd ../libyamlstar\nmake native\nmake install PREFIX=~/.local\n```\n\n### Requirements\n\n- **Free Pascal Compiler (FPC)**: 3.0 or higher\n  - Install from: https://www.freepascal.org/\n  - Or via package manager: `apt install fpc` (Debian/Ubuntu) or `brew install fpc` (macOS)\n- **libyamlstar**: Shared library (installed separately)\n- **System**: Linux or macOS\n\n## Building\n\n```bash\n# Build the binding\nmake build\n\n# Run tests\nmake test\n```\n\n## Quick Start\n\n```pascal\nprogram example;\nuses yamlstar, fpjson;\nvar\n  ys: TYAMLStar;\n  data: TJSONData;\nbegin\n  ys := TYAMLStar.Create;\n  try\n    data := ys.Load('key: value');\n    try\n      WriteLn(data.FormatJSON);\n    finally\n      data.Free;\n    end;\n  finally\n    ys.Free;\n  end;\nend.\n```\n\n## Usage Examples\n\n### Basic Types\n\n```pascal\nuses yamlstar, fpjson;\nvar\n  ys: TYAMLStar;\n  data: TJSONData;\nbegin\n  ys := TYAMLStar.Create;\n  try\n    // Strings\n    data := ys.Load('hello');\n    WriteLn(data.AsString);  // 'hello'\n    data.Free;\n\n    // Integers\n    data := ys.Load('42');\n    WriteLn(data.AsInteger);  // 42\n    data.Free;\n\n    // Floats\n    data := ys.Load('3.14');\n    WriteLn(data.AsFloat);  // 3.14\n    data.Free;\n\n    // Booleans\n    data := ys.Load('true');\n    WriteLn(data.AsBoolean);  // True\n    data.Free;\n\n    // Null\n    data := ys.Load('null');\n    WriteLn(data.JSONType = jtNull);  // True\n    data.Free;\n  finally\n    ys.Free;\n  end;\nend.\n```\n\n### Collections\n\n```pascal\nvar\n  ys: TYAMLStar;\n  data: TJSONData;\n  obj: TJSONObject;\n  arr: TJSONArray;\nbegin\n  ys := TYAMLStar.Create;\n  try\n    // Mappings (objects)\n    data := ys.Load('name: Alice' + LineEnding + 'age: 30');\n    try\n      obj := data as TJSONObject;\n      WriteLn(obj.Strings['name']);  // 'Alice'\n      WriteLn(obj.Integers['age']);  // 30\n    finally\n      data.Free;\n    end;\n\n    // Sequences (arrays)\n    data := ys.Load('[apple, banana, orange]');\n    try\n      arr := data as TJSONArray;\n      WriteLn(arr.Count);  // 3\n      WriteLn(arr.Strings[0]);  // 'apple'\n    finally\n      data.Free;\n    end;\n  finally\n    ys.Free;\n  end;\nend.\n```\n\n### Nested Structures\n\n```pascal\nvar\n  ys: TYAMLStar;\n  data: TJSONData;\n  obj: TJSONObject;\n  yaml: string;\nbegin\n  ys := TYAMLStar.Create;\n  try\n    yaml := 'person:' + LineEnding +\n            '  name: Alice' + LineEnding +\n            '  age: 30' + LineEnding +\n            '  hobbies:' + LineEnding +\n            '    - reading' + LineEnding +\n            '    - coding';\n\n    data := ys.Load(yaml);\n    try\n      WriteLn(data.FormatJSON);\n    finally\n      data.Free;\n    end;\n  finally\n    ys.Free;\n  end;\nend.\n```\n\n### Multi-Document YAML\n\n```pascal\nvar\n  ys: TYAMLStar;\n  docs: TJSONArray;\n  yaml: string;\n  i: Integer;\nbegin\n  ys := TYAMLStar.Create;\n  try\n    yaml := '---' + LineEnding +\n            'name: Document 1' + LineEnding +\n            '---' + LineEnding +\n            'name: Document 2';\n\n    docs := ys.LoadAll(yaml);\n    try\n      for i := 0 to docs.Count - 1 do\n        WriteLn(docs.Items[i].FormatJSON);\n    finally\n      docs.Free;\n    end;\n  finally\n    ys.Free;\n  end;\nend.\n```\n\n### Error Handling\n\n```pascal\nuses yamlstar, SysUtils;\nvar\n  ys: TYAMLStar;\n  data: TJSONData;\nbegin\n  ys := TYAMLStar.Create;\n  try\n    try\n      data := ys.Load('invalid: yaml: syntax');\n      data.Free;\n    except\n      on E: EYAMLStarException do\n        WriteLn('Error loading YAML: ', E.Message);\n    end;\n  finally\n    ys.Free;\n  end;\nend.\n```\n\n### Version Information\n\n```pascal\nvar\n  ys: TYAMLStar;\nbegin\n  ys := TYAMLStar.Create;\n  try\n    WriteLn('YAMLStar version: ', ys.Version);\n  finally\n    ys.Free;\n  end;\nend.\n```\n\n## API Reference\n\n### `TYAMLStar` Class\n\n#### `constructor Create`\nCreate a new YAMLStar instance.\nEach instance maintains its own GraalVM isolate.\n\n```pascal\nys := TYAMLStar.Create;\n```\n\n#### `destructor Destroy`\nDestroys the YAMLStar instance and tears down the GraalVM isolate.\nAlways call `Free` or use a try-finally block to ensure cleanup.\n\n```pascal\nys.Free;\n```\n\n#### `function Load(const YAMLInput: string): TJSONData`\nLoad a single YAML document.\n\n**Parameters:**\n- `YAMLInput`: String containing YAML content\n\n**Returns:**\n- TJSONData object representing the YAML document (TJSONObject, TJSONArray,\n  TJSONString, TJSONIntegerNumber, TJSONFloatNumber, TJSONBoolean, or\n  TJSONNull)\n\n**Raises:**\n- `EYAMLStarException` if the YAML is malformed\n\n**Note:** Caller is responsible for freeing the returned TJSONData.\n\n**Example:**\n```pascal\ndata := ys.Load('key: value');\ntry\n  // Use data\nfinally\n  data.Free;\nend;\n```\n\n#### `function LoadAll(const YAMLInput: string): TJSONArray`\nLoad all YAML documents from a multi-document string.\n\n**Parameters:**\n- `YAMLInput`: String containing one or more YAML documents\n\n**Returns:**\n- TJSONArray containing all documents\n\n**Raises:**\n- `EYAMLStarException` if the YAML is malformed\n\n**Note:** Caller is responsible for freeing the returned TJSONArray.\n\n**Example:**\n```pascal\ndocs := ys.LoadAll('---' + LineEnding + 'doc1' + LineEnding + '---' + LineEnding + 'doc2');\ntry\n  // Use docs\nfinally\n  docs.Free;\nend;\n```\n\n#### `function Version: string`\nGet the YAMLStar version string.\n\n**Returns:**\n- Version string\n\n**Example:**\n```pascal\nversion := ys.Version;\n```\n\n## Library Search Path\n\nThe binding searches for `libyamlstar.so.0` (or `.0.dylib` on macOS) using\nFree Pascal's standard library loading mechanism.\nYou can set `LD_LIBRARY_PATH` to specify custom search paths:\n\n```bash\nexport LD_LIBRARY_PATH=/path/to/lib:$LD_LIBRARY_PATH\n```\n\n## Compilation\n\nTo compile programs using the YAMLStar binding:\n\n```bash\nfpc -Fusrc -Fl/path/to/libyamlstar/lib your_program.pas\n```\n\nWhere:\n- `-Fu` specifies the unit search path\n- `-Fl` specifies the library search path\n\n## License\n\nMIT License - See [License](License) file\n\n## Credits\n\nCreated by Ingy döt Net, inventor of YAML.\n\nYAMLStar is built on the YAML Reference Parser (pure Clojure implementation).\n\n## Links\n\n- **GitHub**: https://github.com/yaml/yamlstar\n- **YAML Specification**: https://yaml.org/spec/1.2/spec.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaml%2Fyamlstar-delphi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyaml%2Fyamlstar-delphi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaml%2Fyamlstar-delphi/lists"}