Organisationsahrefsatdbranch/masterBuild History

Build History for branch/master

Builds (40)
CI: cache opam dependencies, refresh weekly (#472) * CI: cache opam dependencies, refresh weekly (#471) Add restore_cache/save_cache steps to the CircleCI build command, keyed by OCaml version and week number. The cache is restored before installing opam deps and saved afterwards, so subsequent CI runs in the same week skip the slow package installation. Also make setup-opam idempotent: skip the opam repo add/remove if the github repo is already present (as it would be in a cache hit). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Innocuous change to test opam caching --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
a5638a
atdml: fix opam file to not run all project tests (#468) (#470) * atdml: fix opam file to not run all project tests (#468) Add atdml.opam.template (same build section as atd.opam.template) so that dune does not inject @runtest into the generated atdml.opam. Without the template, dune 3.18 adds @runtest {with-test} whenever a package has :with-test deps, which caused opam-repository CI to run the whole project's test suite when installing atdml. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Add placeholder to changelog * Fix minimum atd version in dune-project --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
702e1c
Another revision of the release notes for 4.0.0
862388
Finalize release notes for 4.0.0
0997e5
Fix support matrix (#467) * Add feature support matrix to documentation Adds internal/src/main.ml, a small OCaml program that encodes which ATD features each backend supports (Yes/Planned/No) and generates an RST page. Run `make` in internal/ to regenerate doc/support-matrix.rst. The matrix is included in the ATD Project page in the Sphinx docs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * support-matrix: replace 'shared' with 'binary_serialization' 'shared' was specific to Biniou/OCaml and is no longer supported. Replace it with 'binary_serialization' (Biniou format), supported only by atdgen. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Fix support matrix data * s/Dart/D/ * Remove duplicate files --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
002fd2
atdcat: warn on unused imported type names; read from stdin (#466) * Warn on unused imported type names; migrate atdcat tests to Testo atd/src/imports.ml: add warn_unused_imports, called after check_type_refs in util.ml. For each imported type name that never appears in a type expression, a warning is printed to stderr with the source location of the import statement. atdcat/test: replace the dune-rule-based test suite with a Testo executable (test/test.ml). Tests call ATD library functions directly, covering pretty-printing, remove-wraps, and JSON Schema output. A new "unused import warning" test verifies the stderr warning using Testo.stderr snapshot capture. Snapshots stored in atdcat/test/named-snapshots/. Run with: make test (approve with: make test-approve) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * atdcat: rename test/ to tests/, add ./test script Mirrors the atdml layout: tests/ holds the Testo executable and fixtures; test is the shell script the user runs directly. ./test run all tests ./test approve approve new/changed snapshots make test build + run via ./test make test-approve build + approve via ./test approve Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * atdcat/tests: sanitize test names before using as snapshot file names Add make_filename_from_test_name (same as in atdml/tests/test.ml) and a snapshot helper. Snapshot files renamed to replace spaces with underscores. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * atdcat/tests: remove old expected-output files These were used by the old dune diff rules, which have been replaced by Testo snapshots in named-snapshots/. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * atdcat/tests: move ATD input files into tests/input/ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * atdcat: read from stdin when no input file is given When called without file arguments, atdcat now reads from stdin, like cat. Both stdin and file paths are converted to a Lexing.lexbuf and then fed to the single Atd.Util.read_lexbuf call. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
371ad5
Fix parsing of soft keywords in ATD files ('from', 'import', 'as') (#464) Closes #463
9b65bd
Rename files for better clarity (#462)
f77c2f
Add feature support matrix to documentation (#461) * Add feature support matrix to documentation Adds internal/src/main.ml, a small OCaml program that encodes which ATD features each backend supports (Yes/Planned/No) and generates an RST page. Run `make` in internal/ to regenerate doc/support-matrix.rst. The matrix is included in the ATD Project page in the Sphinx docs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * support-matrix: replace 'shared' with 'binary_serialization' 'shared' was specific to Biniou/OCaml and is no longer supported. Replace it with 'binary_serialization' (Biniou format), supported only by atdgen. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Fix support matrix data * Update copyright notice in docs --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1e0033
Upgrade OCaml to 5.3 (from 4.13) as the latest supported version in CI (#460) * Upgrade OCaml to 5.5 (from 4.13) as the latest supported version in CI * with-doc dependency odoc depends on ocaml < 5.4, trying 5.3
923ae0
atdml: Add <ocaml private> and <ocaml public> annotations (#459) * atdml: Add <ocaml private> and <ocaml public> annotations on type defs <ocaml private> forces a 'private' modifier in the generated .mli for any type (record, classic sum, polymorphic variant sum, or alias). <ocaml public> suppresses the default 'private' that atdml already emits for unparameterized primitive aliases (unit/bool/int/float/string). The .ml implementation is never affected. Closes #458. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * atdml: Error if both <ocaml private> and <ocaml public> are on the same type Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
05a15f
Replace 'import' with 'from ... import type1, type2, ...' syntax (#457) * Replace 'import' syntax with 'from ... import type1, type2, ...' The old 'import module' statement is replaced by explicit per-type imports: from module.path [<annots>] [as alias] import type1 [<annots>], type2, ... Key changes: - New AST node 'imported_type' carries name, arity params, and per-type annot - 'import.alias' is now 'string option' (no annotation on alias) - Two-phase validation: Imports.load checks structure; check_type_refs validates all qualified type refs (a.b) against the explicit import list and checks arity - New 'Imported_type' annotation position (node_kind) - atdgen: fatal error if any import statements are present, pointing to atdml - atdpy: auto-escape Python keywords in module alias names (e.g. class -> class_) - All backends updated; all test ATD files converted to new syntax Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Update documentation and changelog for 'from ... import' syntax - CHANGES.md: replace the old import entry with the new from...import entry - atd-language-reference.rst: update keywords list, grammar, and the Import declarations section to describe the new syntax - atdml-reference.rst: rewrite Import declarations section - atdts.rst: rewrite Import declarations section - atdpy.rst: rewrite Import annotations section including auto-escaping of Python keywords in alias names Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
05588d
testing readthedocs webhook
4d2be5
atdml: Add support for <ocaml field_prefix> + no prefix on function labels (#455) * [atdml] Support <ocaml field_prefix="..."> on record types Prefixes are applied to generated OCaml record field names but not to labeled arguments in create_ functions, matching the task description from issue #433 (last comment). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * [atdml] Fix field_prefix keyword safety: apply prefix before keyword check Introduce make_prefixed_trs which builds two separate name translators: - label_tr: keyword-checks the raw field name (no prefix) for labeled args - pftr: concatenates the prefix with the raw name *then* keyword-checks, so "mod"^"ule" = "module" (keyword) → "module_", while the label is "ule"; and "mod"^"if" = "modif" (not a keyword) → "modif", while the label is "if_". Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * [atdml] Extend field_prefix test to cover keyword collision in labels Test 'type t = { ule: int; if: int; if_: int } <ocaml field_prefix="mod">'. Shows that "if_" (ATD) gets label ~if__ because ~if_ was already claimed by the rename of the keyword field "if". Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * [doc] Update atdml-reference: create_, private aliases, field_prefix - Rename all make_ → create_ (make_foo → create_foo, val make → val create) - Add "Primitive type aliases" subsection: documents private type in .mli, create_* constructor, :> coercion, zero runtime overhead - Extend "Reserved name handling" to mention record fields and variants - Add "Field field_prefix" entry under Section ocaml: documents the annotation, the unprefixed-label / prefixed-field split, and the keyword-escaping semantics with the mod+ule/mod+if worked example Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
25c903
atdml: Expose simple type aliases as private types (#454) * [atdml] Private type aliases + rename make_ to create_ For unparameterized aliases of primitive types (unit, bool, int, float, string), the generated .mli now uses 'private': type email = private string This makes the compiler name the alias rather than the underlying type in error messages, and prevents direct construction outside the module. Two helper functions are generated: val create_email : string -> email (* constructor *) val email_to_string : email -> string (* accessor *) These are also exposed as 'val create' and 'val to_string' (etc.) in the per-type submodule (e.g. Email.create, Email.to_string). The .ml implementation keeps a transparent alias, so all functions are identity functions with zero runtime overhead. Record creation functions are renamed from 'make_foo' to 'create_foo' (and 'val make' → 'val create' in the submodule) to give them a consistent name with the new primitive alias constructors and to match the convention already used by atdgen. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * [atdml] Drop to_primitive accessors; coerce with :> instead Remove the generated 'score_to_float' / 'id_to_string' functions and their submodule counterparts ('val to_float', 'val to_string'). Coercion back to the primitive type is trivially done with the ':>' operator (e.g. '(x :> string)') and doesn't need a generated helper. Keep 'create_score' / 'val create' as the constructor. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
0f6459
Add 'import' construct allowing splitting ATD definitions into multiple files (#451) * Add import statement support: aliases and per-component annotations The ATD language now supports full import declarations of the form: import module.path <path-annotations> as alias <alias-annotations> Key changes: ATD core (atd/): - New `module_` record type replaces `full_module` tuple; `import` and `type_def` are now proper top-level fields - `import` record has separate `annot` (path annotations) and `alias: (string * annot) option` (alias with its own annotations) - `type_def` changed from a tuple to a record with named fields - New `Imports` module for loading and resolving import tables - New `Type_name` and `Stdlib_extra` helper modules - Parser supports `import`, `as` as keywords; lexer emits IMPORT/AS tokens - `import foo.bar` (no alias): local name defaults to last component `bar` - `import foo.bar as baz`: local name is `baz` - Dotted qualified names `foo.bar` in type expressions refer to imported types Code generators (atdml, atdpy, atdts): - Updated for the new AST types - `py_module_of_import` reads path annotation for Python module file name - `py_name_of_import` checks alias annotation first, then path annotation - `ts_name_of_import` and `ocaml_name_of_import` follow the same priority - Language-specific `name` annotation on the path controls the module file name; the same annotation on the alias controls the local name Example (Python): import def <python name="def_"> as class <python name="class_"> Python output: import def_ as class_ All backends updated (atdcat, atdcpp, atdd, atddiff, atdgen, atdj, atds). Tests added for import aliases in atdpy, atdts, and atdml. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Update docs and changelog for import statement support - CHANGES.md: document import declarations with alias and per-component name annotations - doc/atd-language-reference.rst: update grammar and add "Import declarations" section - doc/atdml-reference.rst: add "Import declarations" section - doc/atdpy.rst: add "Import annotations" subsection - doc/atdts.rst: add "Import declarations" subsection Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Fix atdcat: restore -remove-wraps and update expected test output The import refactoring commit dropped Atd.Ast.remove_wrap_constructs, breaking the -remove-wraps flag in atdcat. Restore the function using the existing Map.module_ infrastructure, and update the atdcat expected test files to include the import lines now present in test.atd. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Add a note into atdd's source code * Fix atdgen: restore <json repr="string"> support for int types The import refactoring commit accidentally dropped type json_int and get_json_int from atd/src/json.ml, collapsing Int of json_int into plain Int in json_repr. This broke the <json repr="string"> annotation for integer types (char, int32, int64, float-as-int), causing writers like write_int32_as_string to be replaced with bare write_int32. Restore json_int, Int of json_int, and get_json_int in json.ml/mli, and update oj_mapping.ml, oj_emit.ml, and omelange_emit.ml accordingly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * atdgen: ignore runtime test output files The test suite writes *.bin and *.json files to the working directory. Add a .gitignore to keep them out of git status. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * atdgen: update snapshots for wildcard type variable change The import refactoring changed how type parameters are handled, causing the code generator to emit _ wildcard type variables instead of named type variables in type annotations (e.g. 'a param -> _ param). Update all affected expected.ml snapshot files. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Review fixes: remove dead code, simplify, fix doc - stdlib_extra.ml: remove dead `mapi` function (it had reversed argument order compared to List.mapi and was never called; the stdlib List.mapi is used directly through `include List`) - ast.ml/mli: simplify local_name_of_import to x.name (the `name` field already holds the resolved local name, making the match redundant) - doc/atdts.rst: fix generated import file path in example: atdts uses only the last component of a dotted module path (e.g. "./path" not "./long.module.path") Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Follow-up improvements from code review - Merge import.ml into stdlib_extra.ml: import.ml now just re-exports stdlib_extra.ml via `include Stdlib_extra`, eliminating the duplicated utility code. - atd/imports.ml: use Hashtbl.Make with a PathTbl functor (keyed on string list) for the globals deduplication table, replacing the polymorphic Hashtbl. - atdts: dotted module paths in import declarations now map to path separators in the generated TypeScript import. For example, `import long.module.path` generates `./long/module/path` rather than just `./path`. - Add a gen-expect test for dotted module path imports in atdts. - doc/atd-language-reference.rst: add an experimental warning about dotted module paths, noting that their behavior may vary across backends and support may be removed in a future release. - doc/atdts.rst: update import path example to reflect the path-separator behavior for dotted module paths. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Update example --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
afe785
Update atdml's readme (#452)
b4b058
Update OCaml support details in README
d313ee
Use hash tables to read large objects a little faster (#447) This is an optimization for which we have no benchmarks so it may be a little off. A hash table is used when reading a JSON object with more than 5 bindings. This number should be adjusted once we have benchmarks. Further optimizations are possible too but the current performance should be good enough for typical uses of JSON regardless.
fb07c1
atdml: a simpler replacement for atdgen (#446) * Add atdml: simplified OCaml JSON code generator using Yojson AST Introduces two new packages: - atdml-runtime: small runtime library with helpers for reading/writing primitive types, lists, options, and nullables via Yojson.Safe.t. - atdml: code generator that takes an ATD file and produces a single foo.ml + foo.mli module pair. Unlike atdgen, it uses Yojson.Safe.t as the intermediate representation throughout, making the generated code straightforward to read and the generator easy to maintain. Naming follows the ppx_yojson_conv convention (foo_of_yojson / yojson_of_foo). Classic variants are the default; polymorphic variants are opt-in per sum type via <ocaml repr="poly">. Includes a cram test, README, Makefile, and opam package definitions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * [atdml] Inline runtime into each generated .ml; remove atdml-runtime package The atdml-runtime library was tiny (< 70 lines). Instead of shipping it as a separate package that every user of atdml-generated code must depend on, emit it verbatim as a private `module Atdml_runtime = struct ... end` at the top of each generated `.ml` file. Benefits: - Generated files only depend on `yojson`; no second package to install. - Simpler dune file for downstream users (no `atdml-runtime` entry). - The runtime stays in sync with the generator automatically. Removes the `atdml-runtime` opam package and its source directory entirely. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * [atdml] Support multiline strings in Indent.Line; simplify runtime_module Indent.to_buffer now splits a Line containing newlines into sub-lines, each printed at the current indentation level. This allows passing a raw multiline string literal to the Line constructor instead of one Line node per line. Use this to rewrite Codegen.runtime_module as a single B.Line holding a {|...|} raw string — much easier to read and edit in place. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * [atdml] Add comprehensive codegen cram tests Adds codegen.t covering all ATD constructs and annotations supported by atdml: - Type aliases (string, float, list, option) - Classic sum types: plain constructors, constructors with payloads, <json name> and <ocaml name> renaming - Polymorphic variants via <ocaml repr="poly"> - Records: required, optional (?), with-default (~) fields; implicit defaults for common types; explicit <ml default="...">; <json name> field renaming (annotations go before the ':', per ATD convention) - All builtin types and composites: unit, bool, int, float, string, list, option, nullable, abstract, tuple, nested - Parametric types with one and two type variables - Mutually recursive types (ATD types are implicitly mutually recursive; no 'and' keyword needed) Both .mli and .ml output are checked for the records case; .mli only for the others to avoid repeating the inlined runtime block. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * [atdml] Use <ocaml ...> exclusively, drop <ml ...> support Aligns atdml with atdgen: the only annotation section for OCaml-specific options is <ocaml ...>, matching what atdgen users already write. - Rename annot_schema_ml -> annot_schema_ocaml (section "ocaml") - Rename get_ml_default -> get_ocaml_default (reads from "ocaml" only) - Register exactly the three annotations atdml uses, with correct ATD node-kind contexts: Type_expr "repr" -- <ocaml repr="poly"> on a sum type Variant "name" -- <ocaml name="..."> on a variant constructor Field "default"-- <ocaml default="..."> on a with-default field Previously the "ocaml" section was absent from the schema so these annotations were silently accepted; now the validator enforces them. - Update codegen.t and README to use <ocaml default="..."> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * [atdml] Replace cram tests with Testo snapshot tests - Convert atdml/test/*.t (cram) to atdml/tests/test.ml (Testo) - Rename test/ directory to tests/ and add shell wrapper at atdml/test - Snapshots stored as flat files in tests/named-snapshots/ - Tests cover all supported ATD constructs and <ocaml ...> annotations - Add testo dependency to atdml package and atdml.opam - Add fpath dependency to test executable - Update Makefile to run atdml tests via $(MAKE) -C atdml test - Update generated file header to say "by atdml." Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Compile and run the generated code + some debugging * Fix some tests and simplify the invocation of atdml * Add contributing instructions for atdml * Update gitignore * [atdml] Compile and run the generated code + some debugging - Run atdml from tests using the installed binary instead of calling Codegen.run_file directly (this also tests the CLI interface) - Extend tests to compile the generated code with ocamlfind, run it on sample JSON input, and capture the output as part of the snapshot - Fix Codegen.ml: use explicit universal quantification ('a. ...) for parametric functions in let rec...and blocks to prevent OCaml from fixing the type of one function based on how it is called by another function in the same block - Fix various JSON inputs in tests (invalid token 'abstract', wrong variant name 'rect' vs 'rectangle', missing closing '}') - Update snapshots to reflect new ATD sources and output format Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * [atdml] Add submodules, rename json I/O functions, rename reserved OCaml names - Generate a submodule (e.g. `module Foo`) for each ATD type, with `type nonrec t = foo`, `of_yojson`, `to_yojson`, `of_json`, `to_json` (and `make` for record types) - Rename top-level I/O functions: `foo_of_json`/`json_of_foo` (was `foo_of_string`/`string_of_foo`); drop `_of_channel`/`_of_file` - Use `Atd.Unique_name` to rename ATD type names that conflict with OCaml keywords or with the generated function naming scheme (e.g. `yojson`, `json`); names get a `_` suffix or similar to avoid conflicts - Add tests for problematic ATD type names (`yojson`, `json`, `module`, including cases where `module_` etc. are already taken) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * [atdml] Update --help to show current interface Show `_of_json`/`json_of_` function names and the generated submodules (Color, Point, etc.) with their `make`, `of_yojson`/`to_yojson`, `of_json`/`to_json` members. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * [atdml] Add Sample_interface.mli documenting the generated interface Shows the expected .mli shape for a non-parametric record type (Foo) and a parametric sum type (Bar), including top-level functions and submodules. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * [atdml] Read from stdin, write self-contained module snippet to stdout When no input file is given, atdml reads ATD source from stdin and prints to stdout: module type Types = sig ... end module Types : Types = struct ... end This snippet can be copy-pasted directly into utop or ocaml. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * [atdml] Use Atd.Util.tsort for minimal recursive groups Use topological sort to emit only strictly necessary 'and'/'let rec' groupings: - Independent types each get their own 'type' declaration - A self-recursive or mutually-recursive group uses 'type ... and ...' - Non-recursive functions use plain 'let'; only recursive groups use 'let rec' (with 'and' for mutually-recursive ones) - Each group's types and functions are emitted together, ordered by dependency (leaf types first) This makes the generated code easier to review and can meaningfully improve OCaml compile times for large ATD files. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * [atdml] Add blank line between foo_of_json and json_of_foo Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * [atdml] Add blank line before each 'and' in type and function groups Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * [atdml] Implement the 'wrap' construct Supports the standard ATD wrap annotations on 'wrap' type expressions: <ocaml module="M"> → M.t, M.wrap, M.unwrap <ocaml module="M" t="T"> → T, M.wrap, M.unwrap <ocaml t="T" wrap="f" unwrap="g"> → fully explicit (no annotation) → identity (behaves like a type alias) - type_expr_str: uses wrap_t (or falls back to inner type) - reader_expr: applies wrap_fn after reading the inner value - writer_expr: applies unwrap_fn before writing the inner value Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * [atdml] Support <ocaml attr="..."> for ppx attributes on type definitions Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * [atdml] Add atdml reference manual Documents all shipped features: type mapping, generated interface, JSON/OCaml annotations (name, attr, default, repr, wrap), optional and default fields, mutually recursive types, parametric types, and reserved name handling. Includes a planned-features section for adapters. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * [atdml] Add changelog entry with full feature list Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * [atdml] Replace List.concat_map with a 4.08-compatible version List.concat_map was added in OCaml 4.10. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Fix syntax in docs * [atdml] Implement JSON adapters Supports <json adapter.ocaml="M"> (module with normalize/restore) and <json adapter.to_ocaml="f" adapter.from_ocaml="g"> (inline expressions) on sum types and records. Also adds extra_sources parameter to test_e2e for supplying auxiliary OCaml modules needed by individual tests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * [atdml] Propagate <ocaml attr="..."> to the submodule type alias Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * [atdml] Add <doc text="..."> support, generating ocamldoc comments Type-level docs are prepended as (** ... *) before the type declaration. Field and variant docs are appended inline as (** ... *) on the same line. Multi-paragraph docs and preformatted blocks ({{{ }}}) are rendered using standard ocamldoc conventions ({v ... v} for verbatim text). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * [atdml] Post-review improvements - Remove stale Sample_interface.mli (named-snapshots are the canonical reference) - Add module-level <doc text="..."> support (head annotation was silently ignored) - Expand "doc" test with mutually recursive types to show (** ... *) before 'and' - Add comment in dune-project: build tools require dune >= 3.18, generated code targets OCaml >= 4.08 - Auto-rename record fields and variant constructors that conflict with OCaml keywords, using Atd.Unique_name per-scope; <ocaml name="..."> on fields is not supported for simplicity Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * [atdml] Improve compatibility with real-world ATD files - Accept <ocaml module="..."> / <ocaml t="..."> on type definitions and <ocaml name="..."> on record fields with a warning (annotation ignored); these are atdgen-isms that atdml does not implement - Implement <json repr="object"> for (string * 'a) list: encodes as a JSON object {"k": v} rather than an array of pairs - ~field: user_type with no OCaml default no longer errors: warns and treats the field as required in JSON; make_* is skipped for that type - All annotation warnings are emitted in a single upfront pass, deduplicated by source location (no repeated warnings for inherited fields) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
5cf847
Require dune >= 3.18 (April 2025) (#445) * Require dune >= 3.18 (March 2025) so as to support emitting the 'x-maintenance-intent' file for opam files * Fix new warnings
5a00d7
[atdgen] Restore behavior where '-j-std' implies '-j' and print a warning (#444) The following test should print code that's related to JSON and not Biniou: $ echo 'type t = int' | ./_build/install/default/bin/atdgen -j-std
5cd986
Fix version constraint
7b0863
Update author list from git
45daef
Update the docs (#442) Update docs (empty but visible sections for D and C++)
d115be
Cleanup: gitignore generated test files (#441) * Gitignore generated file * Gitignore generated C++ files
4bae3f
Add Atdgen runtime compatibility with Yojson 3 (#439) * Bring back start_any_variant * Import the missing Yojson functions 'start_any_variant' and 'start_any_tuple' which were accidentally removed from Yojson. * Add more missing parsing functions to Yojson_extra * Update test expectations * Remove outdated TODO.md. We're using GitHub issues instead. * Update package version constraints * Add comment on vendored file * Add link to GitHub issue --------- Co-authored-by: Kate <kit-ty-kate@exn.st>
3cd7c2
Remove `-j-std` (#425) * Remove `-j-std`, now default everywhere * Harmonize test filenames * Update `CHANGES.md` * Clean-up documentation from `-j-std` * Put back `-json` for teststd (the `create_` functions) * Generalize and document use of `ATDGEN_FAIL_DEPRECATED_OPTIONS`
ffbefb
[atdts] Avoid "make: node: Permission denied" (#437) Avoid "make: node: Permission denied" occurring on my machine when running the atdts tests
f6f63b
[atdpy] Honor <doc text="..."> annotations and turn them into Python docstrings (#435) * Inject definition-level <doc ...> comments into Python class definitions as docstrings (partially done) * Move rewrap_paragraph to the shared Doc module * Escape docstring contents * Done with records * Done with sum types * Done with aliases * Done with module-level docstring * Fix spacing bug * Update changelog
af65c2
Fix CI (#436) * Upgrade the Ubuntu Docker image used in CI from 20.04 to 24.04 * Upgrade nodeJS from 16 to 24 * Update installation of Python tools * Add version constraint on yojson < 3.0.0
7475b1
README: mention atd-lsp
7f7869
Atdts: supporting <ts from ...> annotation (#429) * atdts: support from annotation on abstract alias * replace export with import * change Null to null * correct unit reader and writer * Reexport types in atdts (#2) * atdts: allow omitting t with from * atdts: add tests * CHANGES.md: update * atdts: annotation should be <ts ...> * atdts: clean up & fix+improve test instrumentation * atdts: fmt * atdts: update docs + CHANGES.md * atdts: restore clean-for-dune but do nothing * rename doc types from ocaml to ts --------- Co-authored-by: ygrek <root@ygrek.org> Co-authored-by: oalgvf <oalgvf@gmail.com>
759b48
Catch and improve display of generic `Parser.Error` (#426) * Catch and improve display of generic `Parser.Error` (#391) * Update `CHANGES.md`
f79565
Add option `-j-gen-modules` to generate JSON generic submodules → #416 (#420) * Add option `-j-gen-modules` (#416) * Add tests for `-j-gen-modules` * Add CHANGES.md entry for #420 * Document `-j-gen-modules`
2fe6aa
Prepare for release 2.16.0
695b06
Add '--ignore' option to atddiff to ensure no types are accidentally unchecked (#422) * Add a '--ignore' option to atddiff to allow detecting types that are not checked by accident * Return a list of known missing root types and handle inherits correctly * Sort the reported type names * Add tests for the new '--ignore' option * Add changelog entry * Revise help message
c37790
Remove the library 'atdgen' which has been deprecated since 2018 (#421) * Remove the library 'atdgen' which has been deprecated since 2018 * Update changelog
63bbe3
Fix JSON I/O for inline records (fix #417) (#419) * Add `_j` test for inline-records * Fix `oj_emit` for inline records (#417) * Add more tests for inline-records (#417) * Add changelog entry
aed89d
atdcpp: use double by default instead of float (#411) * atdcpp: use double by default instead of float * atdcpp: update changes.md
6a5568