From ea55b00c801bd741c67b1f70bc212c01103a295d Mon Sep 17 00:00:00 2001 From: engboris Date: Thu, 2 Oct 2025 21:58:21 +0200 Subject: [PATCH 1/6] Update nvim syntax highlighting --- nvim/ftdetect/stellogen.vim | 2 +- nvim/syntax/stellogen.vim | 53 ++++++++++++++++++++++++++++++------- 2 files changed, 44 insertions(+), 11 deletions(-) diff --git a/nvim/ftdetect/stellogen.vim b/nvim/ftdetect/stellogen.vim index 89fa3f5..ecfe0a1 100644 --- a/nvim/ftdetect/stellogen.vim +++ b/nvim/ftdetect/stellogen.vim @@ -1,2 +1,2 @@ autocmd BufNewFile,BufRead *.sg setfiletype stellogen -autocmd FileType stellogen setlocal shiftwidth=2 softtabstop=2 expandtab +autocmd FileType stellogen setlocal shiftwidth=2 softtabstop=2 expandtab commentstring='\ %s diff --git a/nvim/syntax/stellogen.vim b/nvim/syntax/stellogen.vim index afa0c07..6476680 100644 --- a/nvim/syntax/stellogen.vim +++ b/nvim/syntax/stellogen.vim @@ -1,20 +1,53 @@ -syn clear +if exists("b:current_syntax") + finish +endif -syn keyword sgKeyword new declaration eval slice show use interact fire process -syn match sgComment "\s*'[^'].*$" -syn match sgId "#\%(\l\|\d\)\w*" -syn region sgComment start="'''" end="'''" contains=NONE +" Comments (must be early to take precedence) +syn region sgCommentMulti start="'''" end="'''" contains=NONE +syn match sgComment "'[^'].*$" + +" Strings syn region sgString start=/\v"/ skip=/\v\\./ end=/\v"/ -syn match sgSeparator "[\<\>\{\}\[\]|]" -syn match sgOperator "@" + +" Keywords +syn keyword sgKeyword new declaration eval slice show use interact fire process spec +syn keyword sgConstant ok + +" Operators and separators +syn match sgOperator ":=" syn match sgOperator "::" syn match sgOperator "==" -syn match sgOperator ":=" syn match sgOperator "!=" +syn match sgOperator "||" +syn match sgOperator "@" +syn match sgSeparator "[\<\>\{\}\[\]|]" + +" Polarity markers (+ or - before identifiers) +syn match sgPolarity "[+-]\ze\w" + +" Variables (uppercase starting identifiers) +syn match sgVariable "\<[A-Z_]\w*\>" + +" Defined identifiers in (:= X ...) - both simple and complex +syn match sgDefinedId "\((:=\s\+\)\@<=[a-z_][a-z0-9_]*" +syn match sgDefinedId "\((:=\s\+\)\@<=\d\+" +syn match sgDefinedId "\((:=\s*(\)\@<=[^)]\+" + +" Identifier references (prefixed with #) +syn match sgIdRef "#[a-z_][a-z0-9_]*" +syn match sgIdRef "#\d\+" +syn match sgIdRef "#([^)]\+)" hi link sgKeyword Keyword -hi link sgId Identifier +hi link sgConstant Constant hi link sgComment Comment +hi link sgCommentMulti Comment hi link sgOperator Operator -hi link sgSeparator Special +hi link sgSeparator Delimiter hi link sgString String +hi link sgPolarity Special +hi link sgVariable Type +hi link sgIdRef Identifier +hi link sgDefinedId Function + +let b:current_syntax = "stellogen" From d769a34fffed34b35e7f1e8ae7e640af97479ec2 Mon Sep 17 00:00:00 2001 From: engboris Date: Thu, 2 Oct 2025 21:58:29 +0200 Subject: [PATCH 2/6] Add CLAUDE.md file --- CLAUDE.md | 259 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 259 insertions(+) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..2388524 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,259 @@ +# Stellogen - Project Guide for Claude Code + +## Overview + +Stellogen is an experimental, **logic-agnostic** programming language based on **term unification**. It explores a radically different approach to programming where both computation and meaning are built from the same raw material, without primitive types or fixed logical rules imposed from above. + +**Status:** Research project / proof of concept / esoteric language (not production-ready) + +## Core Philosophy + +Unlike traditional typed languages where types constrain and shape program design, Stellogen offers elementary interactive building blocks where computation and meaning coexist in the same language. The compiler/interpreter's role is reduced to checking that blocks connect - semantic power and responsibility belong entirely to the user. + +## Key Concepts + +### Term Unification +- The fundamental mechanism for both computation and typing +- Terms can be: + - **Variables**: Uppercase start (e.g., `X`, `Y`, `Result`) + - **Functions**: Lowercase or special symbol start (e.g., `(f X)`, `(add X Y)`) +- Unification finds substitutions that make two terms identical + +### Rays and Polarity +- Computation happens through **rays** with polarity: + - `+` positive polarity + - `-` negative polarity + - neutral (no prefix) +- **Fusion**: Term interaction mechanism +- Example: `(+add 0 Y Y)` and `(-add X Y Z)` can fuse during interaction + +### Constellations +- Elementary computational blocks (analogous to logic clauses or functions) +- Defined using `{...}` with multiple rays/clauses +- Example: + ``` + (:= add { + [(+add 0 Y Y)] + [(-add X Y Z) (+add (s X) Y (s Z))]}) + ``` + +### Stars and Interaction +- Stars are terms that can interact via `interact` +- `@` prefix: evaluates before interaction +- `#` prefix: reference to a defined term + +## Syntax Elements + +### Comments +- Single-line: `' comment text` +- Multi-line: `''' comment text '''` + +### Syntactic Sugar +- **Stack notation**: `` equivalent to `(f (a (b c)))` +- **Cons lists**: `[1|Tail]` for list construction +- **Groups**: `{...}` for constellations +- **Process chaining**: `(process X {Y Z})` chains constellations + +### Declarations +- **Definition**: `(:= name value)` +- **Macro**: `(new-declaration (pattern) (expansion))` +- **Show**: `(show expr)` - display result +- **Expect**: Assertion/testing mechanism + +### Syntax Reference +**See `examples/syntax.sg`** for comprehensive examples of all syntactic features including: +- Rays, stars, and constellations +- Focus (`@`) and identifiers (`#`) +- String literals, cons lists, and stack notation +- Linear (`fire`) vs non-linear (`interact`) execution +- Inequality constraints (`|| (!= X Y)`) +- Process chaining +- Fields and field access +- Nested structures +- File imports with `(use "path")` + +### Type System (Unconventional) +Types are defined as **sets of interactive tests**: +``` +(spec binary { + [(-i []) ok] ' returns [ok] on empty list + [(-i [0|X]) (+i X)] ' matches on [0] and checks the tail + [(-i [1|X]) (+i X)]}) ' matches on [1] and checks the tail +``` + +Type checking: `(:: value type)` triggers interaction and expects `ok` + +## Project Structure + +``` +stellogen/ +├── src/ # OCaml source code +│ ├── sgen_ast.ml # AST definitions +│ ├── sgen_eval.ml # Evaluator +│ ├── sgen_parsing.ml # Parser +│ ├── unification.ml # Unification engine +│ ├── lexer.ml # Lexer +│ ├── lsc_*.ml # LSC (constellation) components +│ └── expr*.ml # Expression handling +├── bin/ # Executable entry points +│ └── sgen.ml # Main CLI +├── test/ # Test suite +├── examples/ # Example programs (.sg files) +│ ├── nat.sg # Natural numbers +│ ├── prolog.sg # Logic programming examples +│ ├── automata.sg # Finite state machines +│ ├── lambda.sg # Lambda calculus +│ └── ... +├── exercises/ # Learning exercises +└── nvim/ # Neovim integration +``` + +## Multi-Paradigm Support + +| Paradigm | Stellogen Equivalent | +|-----------------|-------------------------------------------------------| +| Logic | Constellations (elementary blocks) | +| Functional | Layered constellations enforcing interaction order | +| Imperative | Iterative recipes for building constellations | +| Object-oriented | Structured constellations | + +## Building & Running + +### Build from Sources (Dune) +```bash +# Install dependencies +opam install . --deps-only --with-test + +# Build +dune build + +# Executables in: _build/default/bin/ +``` + +### Build with Nix +```bash +nix develop +dune build +``` + +### Running Programs +```bash +# Using built executable +./sgen.exe run + +# Using Dune +dune exec sgen run -- + +# Help +./sgen.exe --help +``` + +## File Extensions +- `.sg` - Stellogen source files +- `.mml` - Alternative extension (legacy?) + +## Example: Natural Number Addition + +```stellogen +' Define addition constellation +(:= add { + [(+add 0 Y Y)] + [(-add X Y Z) (+add (s X) Y (s Z))]}) + +' Query: 2 + 2 = R +(:= query [(-add R) R]) + +' Execute interaction +(show (interact #add @#query)) +``` + +## Example: Type Definition + +```stellogen +' Macro for type specification +(new-declaration (spec X Y) (:= X Y)) + +' Macro for type assertion +(new-declaration (:: Tested Test) + (== @(interact @#Tested #Test) ok)) + +' Define nat type as interactive tests +(spec nat { + [(-nat 0) ok] + [(-nat (s N)) (+nat N)]}) + +' Define and check values +(:= 0 (+nat 0)) +(:: 0 nat) ' succeeds +``` + +## Dependencies (OCaml) +- `base` - Standard library alternative +- `menhir` - Parser generator +- `sedlex` - Unicode-friendly lexer +- `ppx_deriving` - Code generation +- `alcotest` - Testing framework + +## Key Implementation Files + +- `src/sgen_ast.ml` - Core AST types: `sgen_expr`, `declaration`, `program` +- `src/unification.ml` - Term unification algorithm +- `src/sgen_eval.ml` - Expression evaluator and interaction engine +- `src/lsc_ast.ml` - Low-level constellation representation +- `bin/sgen.ml` - CLI entry point + +## Testing + +Run tests with: +```bash +dune test +``` + +## Influences & Related Work + +- **Prolog/Datalog**: Unification and logic programming +- **Smalltalk**: Minimalism and message-passing +- **Rocq/Coq**: Proof-as-program paradigm +- **Scheme/Racket**: Metaprogramming spirit +- **Shen**: Optional type systems philosophy +- **Girard's Transcendental Syntax**: Theoretical foundation + +## Learning Resources + +- **Wiki**: https://github.com/engboris/stellogen/wiki/Basics-of-Stellogen +- **Examples**: See `examples/` directory for practical demonstrations +- **README**: Project overview and philosophy + +## Working with this Codebase + +### When modifying: +1. The language is **experimental** - syntax and semantics change frequently +2. Understand term unification before touching `unification.ml` +3. AST changes require updates to parser, evaluator, and pretty-printer +4. Test with existing examples in `examples/` after changes + +### Important concepts for contributors: +- **Polarity** drives interaction - positive/negative rays fuse +- **Constellations** are the core computational unit +- **Stars** are terms prepared for interaction +- The evaluator orchestrates term interactions, not traditional evaluation + +### Debugging tips: +- Use `(show ...)` to inspect intermediate results +- Examine `examples/*.sg` for canonical usage patterns +- Parser errors: check parenthesis balance and syntax sugar +- Unification failures: verify term structure and polarity + +## License + +GPL-3.0-only + +## Maintainers + +- Author: Boris Eng +- Maintainer: Pablo Donato + +--- + +*Last updated: 2025-10* +*For current implementation details, always refer to the wiki and source code as the language evolves rapidly.* From 49a6fec0d2f38ae0d134c230361b6505adf2147a Mon Sep 17 00:00:00 2001 From: engboris Date: Thu, 2 Oct 2025 22:07:25 +0200 Subject: [PATCH 3/6] Update Prolog test --- examples/prolog.sg | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/examples/prolog.sg b/examples/prolog.sg index 08b26a0..820e0c1 100644 --- a/examples/prolog.sg +++ b/examples/prolog.sg @@ -1,27 +1,50 @@ +''' ARITHMETIC ''' + ' unary addition (:= add { [(+add 0 Y Y)] [(-add X Y Z) (+add (s X) Y (s Z))]}) ' 2 + 2 = R -(:= query [(-add R) R]) +(:= query1 [(-add R) R]) +(show (interact #add @#query1)) + + +''' FAMILY RELATIONSHIPS ''' + +' family facts +(:= family { + [(+parent tom bob)] + [(+parent tom liz)] + [(+parent bob ann)] + [(+parent bob pat)] + [(+parent pat jim)]}) + +' grandparent relationship +(:= grandparent { + [(-grandparent X Z) (-parent X Y) (+parent Y Z)]}) + +' who is tom's grandchild? +(:= query5 [(-grandparent tom Z) Z]) +(show (interact #grandparent @(process #query5 #family))) + -(show (interact #add @#query)) +''' GRAPH TRAVERSAL ''' (:= graph { [(+from 1) (+to 2)] [(+from 1) (+to 3)] [(+from 3) (+to 2)] - '[(+from 4) (+to 3)] - [(+from 3) (+to 4)]}) + [(+from 3) (+to 4)] + [(+from 2) (+to 5)]}) (:= composition [(-to X) (-from X)]) ' is there a path between 1 and 4? -(:= query { +(:= query6 { @[(-from 1)] [(-to 4) ok]}) From 462e533e85187c735df39a072f746e8b38f80469 Mon Sep 17 00:00:00 2001 From: engboris Date: Thu, 2 Oct 2025 22:22:45 +0200 Subject: [PATCH 4/6] Add Cram tests --- dune-project | 2 +- stellogen.opam | 1 - test/README.md | 49 ++++++++++++++++++ test/dune | 9 ++-- test/examples.t | 93 +++++++++++++++++++++++++++++++++++ test/subjects.t | 11 +++++ test/{test.ml => test.ml.old} | 0 7 files changed, 158 insertions(+), 7 deletions(-) create mode 100644 test/README.md create mode 100644 test/examples.t create mode 100644 test/subjects.t rename test/{test.ml => test.ml.old} (100%) diff --git a/dune-project b/dune-project index a6bf5a6..cb5d425 100644 --- a/dune-project +++ b/dune-project @@ -19,7 +19,7 @@ (name stellogen) (synopsis "Stellogen is a minimalistic and logic-agnostic programming language based on term unification.") - (depends base menhir (alcotest :with-test) sedlex ppx_deriving) + (depends base menhir sedlex ppx_deriving) (tags ("transcendental syntax" "logic programming" "constraint programming" "resolution logic" "unification" "self-assembly"))) diff --git a/stellogen.opam b/stellogen.opam index 8c1e23c..beb7ca2 100644 --- a/stellogen.opam +++ b/stellogen.opam @@ -21,7 +21,6 @@ depends: [ "dune" {>= "3.7"} "base" "menhir" - "alcotest" {with-test} "sedlex" "ppx_deriving" "odoc" {with-doc} diff --git a/test/README.md b/test/README.md new file mode 100644 index 0000000..3eb7feb --- /dev/null +++ b/test/README.md @@ -0,0 +1,49 @@ +# Stellogen Tests + +This directory contains Cram tests for Stellogen. + +## Test Files + +- `subjects.t` - Tests for basic syntax subjects in `test/subjects/` +- `examples.t` - Tests for all examples in `examples/` + +## Running Tests + +Run all tests: +```bash +dune test +``` + +Run tests and update expected outputs: +```bash +dune test --auto-promote +``` + +Run specific test file: +```bash +dune test test/examples.t +``` + +## About Cram Tests + +Cram tests are simple text-based tests that show shell commands and their expected outputs: + +``` + $ command + expected output +``` + +When a test runs successfully without any expected output specified, it just verifies the command exits successfully (exit code 0). + +## Adding New Tests + +To add a new test: + +1. Create a `.t` file in this directory +2. Write commands starting with ` $ ` (two spaces, dollar sign, space) +3. Run `dune test --auto-promote` to capture the output +4. Review the promoted output and commit + +## Modifying Test Dependencies + +Test dependencies are declared in `test/dune`. If you add new test fixtures, add them to the `deps` section. diff --git a/test/dune b/test/dune index 723e018..ff552cd 100644 --- a/test/dune +++ b/test/dune @@ -1,11 +1,10 @@ -(test - (name test) - (modules test) +; Cram tests for Stellogen examples and subjects +(cram (deps (glob_files ./subjects/*.sg) (glob_files ../examples/*.sg) - (glob_files ../exercises/solutions/*.sg)) - (libraries alcotest base stellogen)) + (glob_files ../exercises/solutions/*.sg) + (package stellogen))) (env (dev diff --git a/test/examples.t b/test/examples.t new file mode 100644 index 0000000..79acd6e --- /dev/null +++ b/test/examples.t @@ -0,0 +1,93 @@ +Test examples directory +======================== + +Automata example: + $ sgen run ../examples/automata.sg + {} + accept + {} + {} + +Binary4 example: + $ sgen run ../examples/binary4.sg + { [(+b b1 4 1)] [(+b b1 3 0)] [(+b b1 2 0)] [(+b b1 1 0)] } + { [(+b b2 4 1)] [(+b b2 3 1)] [(+b b2 2 0)] [(+b b2 1 0)] } + { [(+b r 4 1)] [(+b r 3 0)] [(+b r 2 0)] [(+b r 1 0)] } + { [(+b r 4 1)] [(+b r 3 1)] [(+b r 2 0)] [(+b r 1 0)] } + { [(+b r 4 0)] [(+b r 3 1)] [(+b r 2 1)] [(+b r 1 1)] } + { [(+b r2 4 0)] [(+b r2 3 1)] [(+b r2 2 1)] [(+b r2 1 1)] } + +Circuits example: + $ sgen run ../examples/circuits.sg + { [(-c3 0) (-1 0) (-c2 0) (-not 0 0) 0 0] [(-c3 0) (-c2 1) 0 0] } + { [(-0 1)] [(-not 0 0)] } + +Lambda calculus example: + $ sgen run ../examples/lambda.sg + [(out (%cons r X7)) (ida (exp (%cons l X7) d))] + [(out X7) (x (exp X7 d))] + +Linear lambda example: + $ sgen run ../examples/linear_lambda.sg + {} + {} + +MALL (multiplicative-additive linear logic) example: + $ sgen run ../examples/mall.sg + { [(-3 (%cons r (%cons l X4))) (-3 (%cons r (%cons r X4))) || (slice c b)] [(c X11) (d X11) || (slice c a)] } + +MLL (multiplicative linear logic) example: + $ sgen run ../examples/mll.sg + {} + +Natural numbers example: + $ sgen run ../examples/nat.sg + (+nat (s (s (s 0)))) + (res 1) + (res 0) + +NPDA (non-deterministic pushdown automaton) example: + $ sgen run ../examples/npda.sg + { [accept] [accept] } + accept + accept + {} + +Prolog-style examples: + $ sgen run ../examples/prolog.sg + (s (s (s (s 0)))) + [(-grandparent tom Z0) Z0] + { [ok (-to 1)] [(-from 5)] [(-from 4)] [(-from 5)] } + +Stack example: + $ sgen run ../examples/stack.sg + (save 0) + +Sum types example: + $ sgen run ../examples/sumtypes.sg + a + +Syntax reference: + $ sgen run ../examples/syntax.sg + a + { [c] [b] [a] } + (%string hello world) + (function a b) + { [(-f X0) (-f Y0) (r X0 Y0) || (!= X Y)] [(+f b)] [(+f a)] } + { [(r b a) || (!= b a)] [(r a b) || (!= a b)] } + (+n2 (s (s 0))) + { [(+field test2) (%cons (+f b) (%cons ok %nil))] [(+field test1) (%cons (+f a) (%cons ok %nil))] } + [(+f a) ok] + [(+f b) ok] + (-field test2) + +Turing machine example: + $ sgen run ../examples/turing.sg + reject + reject + reject + accept + accept + accept + accept + accept diff --git a/test/subjects.t b/test/subjects.t new file mode 100644 index 0000000..3b1e1b9 --- /dev/null +++ b/test/subjects.t @@ -0,0 +1,11 @@ +Test subjects - basic syntax tests +===================================== + +Linear execution test: + $ sgen run subjects/linear.sg + +Prolog-style test: + $ sgen run subjects/prolog.sg + +Records test: + $ sgen run subjects/records.sg diff --git a/test/test.ml b/test/test.ml.old similarity index 100% rename from test/test.ml rename to test/test.ml.old From 0e69b8b2e582b0f4f3c90f6011b00495d9adcd57 Mon Sep 17 00:00:00 2001 From: engboris Date: Thu, 2 Oct 2025 22:34:06 +0200 Subject: [PATCH 5/6] Rename subject tests and remove old tests --- test/README.md | 2 +- test/dune | 4 +-- test/subjects.t | 11 -------- test/syntax.t | 11 ++++++++ test/{subjects => syntax}/linear.sg | 0 test/{subjects => syntax}/prolog.sg | 0 test/{subjects => syntax}/records.sg | 0 test/test.ml.old | 38 ---------------------------- 8 files changed, 14 insertions(+), 52 deletions(-) delete mode 100644 test/subjects.t create mode 100644 test/syntax.t rename test/{subjects => syntax}/linear.sg (100%) rename test/{subjects => syntax}/prolog.sg (100%) rename test/{subjects => syntax}/records.sg (100%) delete mode 100644 test/test.ml.old diff --git a/test/README.md b/test/README.md index 3eb7feb..0ce54f8 100644 --- a/test/README.md +++ b/test/README.md @@ -4,7 +4,7 @@ This directory contains Cram tests for Stellogen. ## Test Files -- `subjects.t` - Tests for basic syntax subjects in `test/subjects/` +- `syntax.t` - Tests for basic syntax in `test/syntax/` - `examples.t` - Tests for all examples in `examples/` ## Running Tests diff --git a/test/dune b/test/dune index ff552cd..61a5d1a 100644 --- a/test/dune +++ b/test/dune @@ -1,7 +1,7 @@ -; Cram tests for Stellogen examples and subjects +; Cram tests for Stellogen examples and syntax (cram (deps - (glob_files ./subjects/*.sg) + (glob_files ./syntax/*.sg) (glob_files ../examples/*.sg) (glob_files ../exercises/solutions/*.sg) (package stellogen))) diff --git a/test/subjects.t b/test/subjects.t deleted file mode 100644 index 3b1e1b9..0000000 --- a/test/subjects.t +++ /dev/null @@ -1,11 +0,0 @@ -Test subjects - basic syntax tests -===================================== - -Linear execution test: - $ sgen run subjects/linear.sg - -Prolog-style test: - $ sgen run subjects/prolog.sg - -Records test: - $ sgen run subjects/records.sg diff --git a/test/syntax.t b/test/syntax.t new file mode 100644 index 0000000..e5acc5a --- /dev/null +++ b/test/syntax.t @@ -0,0 +1,11 @@ +Test syntax - basic syntax tests +================================== + +Linear execution test: + $ sgen run syntax/linear.sg + +Prolog-style test: + $ sgen run syntax/prolog.sg + +Records test: + $ sgen run syntax/records.sg diff --git a/test/subjects/linear.sg b/test/syntax/linear.sg similarity index 100% rename from test/subjects/linear.sg rename to test/syntax/linear.sg diff --git a/test/subjects/prolog.sg b/test/syntax/prolog.sg similarity index 100% rename from test/subjects/prolog.sg rename to test/syntax/prolog.sg diff --git a/test/subjects/records.sg b/test/syntax/records.sg similarity index 100% rename from test/subjects/records.sg rename to test/syntax/records.sg diff --git a/test/test.ml.old b/test/test.ml.old deleted file mode 100644 index 0af74b3..0000000 --- a/test/test.ml.old +++ /dev/null @@ -1,38 +0,0 @@ -open Base - -let sgen filename () = - let lexbuf = Sedlexing.Utf8.from_channel (Stdlib.open_in filename) in - let expr = Stellogen.Sgen_parsing.parse_with_error filename lexbuf in - let preprocessed = Stellogen.Expr.preprocess expr in - match Stellogen.Expr.program_of_expr preprocessed with - | Ok p -> Stellogen.Sgen_eval.eval_program p - | Error e -> - let open Stellogen.Sgen_eval in - begin - match pp_err (ExprError e) with - | Ok pp -> - Out_channel.output_string Out_channel.stderr pp; - Error (ExprError e) - | Error e -> Error e - end - -let make_ok_test name path f = - let test got () = - Alcotest.(check bool) "ending with success" true (Result.is_ok got) - in - (name, `Quick, test (f (path ^ name) ())) - -let run_dir test_f directory = - Stdlib.Sys.readdir directory - |> Array.to_list - |> List.filter ~f:(fun f -> - not @@ Stdlib.Sys.is_directory (Stdlib.Filename.concat directory f) ) - |> List.map ~f:(fun x -> make_ok_test x directory test_f) - -let () = - Alcotest.run "Stellogen Test Suite" - [ ("Stellogen examples", run_dir sgen "../examples/") - ; (* ; ("Stellogen exercises solutions", run_dir sgen "../exercises/solutions/") - ; *) - ("Stellogen syntax", run_dir sgen "./subjects/") - ] From 9689f2a424ebcca7a825bcd1fe8f9fa179e62ad0 Mon Sep 17 00:00:00 2001 From: engboris Date: Thu, 2 Oct 2025 23:07:57 +0200 Subject: [PATCH 6/6] Format --- test/dune | 1 + 1 file changed, 1 insertion(+) diff --git a/test/dune b/test/dune index 61a5d1a..d5857f7 100644 --- a/test/dune +++ b/test/dune @@ -1,4 +1,5 @@ ; Cram tests for Stellogen examples and syntax + (cram (deps (glob_files ./syntax/*.sg)