Skip to content

Conversation

@johangirod
Copy link
Member

@johangirod johangirod commented Sep 22, 2025

Soon...

👉 Voir l'avancement : Publicodes 2

EmileRolley and others added 30 commits September 19, 2025 15:07
feat: add position to yaml scalar
* Output logs without interupting compilation

* Add warning for orphan rules
* feat: prepare adding type info to eval ast

* feat: add type_database

* feat: first version of type inference

* wip

* feat: type check return error with position
* feat: add cycle check

* wipp

* Add parameter computation
Refactors the evaluation system by replacing direct `evaluate` function
with a properly typed Engine class that supports context parameters.
Renames `evaluate` to `evaluateNode` and updates all relevant tests
and interfaces.
Convert compilation pipeline to produce TypeScript output, restructuring
the evaluation tree and type checking system for better modularity.
Changed position handling to use named parameters for clarity.
* Add support for sum mechanism in Publicodes compiler

Refactor parsing components to better handle expressions and add sum
support:
- Rename expressions directory to expr
- Extract mechanism parsing logic into separate file
- Extend AST to support Sum nodes
- Improve error handling in lexer and parser
- Fix pass numbering in main compiler flow

* Add product and logical operations to compiler

Implement new mechanisms:
- produit
- toutes ces conditions
- une de ces conditions

Update parser, resolver, type checker and code generator to handle
these new operations.

* Enforce single mechanism at the same indentation level in parser

* Add duplicate YAML key detection and handling
Add support for mechanisms in Publicodes compiler

---

Refactor parsing components to better handle expressions and add sum
support:
- Rename expressions directory to expr
- Extract mechanism parsing logic into separate file
- Extend AST to support Sum nodes
- Improve error handling in lexer and parser
- Fix pass numbering in main compiler flow

* Add product and logical operations to compiler

Implement new mechanisms:
- produit
- toutes ces conditions
- une de ces conditions

Update parser, resolver, type checker and code generator to handle
these new operations.

* Enforce single mechanism at the same indentation level in parser

* Add duplicate YAML key detection and handling

* Refactor AST to support more mechanisms

Rename constructors for consistency (BinaryOp→Binary_op, AnyOf→One_of)
Add new value types: Applicable_if, Not_applicable_if, Ceiling, Floor
Replace parse_mechanism with parse_value for better structure
Improve position handling in AST with naked_value type
Rename from_list to all_keep_logs for clarity

* Refactor AST to separate value and chainable mechanisms

Add a new structure where values have a list of chainable mechanisms
that are applied in order, rather than having them nested. This makes
the AST more consistent and the code more maintainable.

* Uncomment parser code and add chainable mechanisms tests

Update test assertions to work with new value structure containing
chainable mechanisms. Change p function to require length parameter.

* Remove parser utility functions

* Fix type checking for conditional expressions

Ensure condition is Bool type and result type matches branch type.
Make pattern matching more explicit for Undefined and Null cases.
@changeset-bot
Copy link

changeset-bot bot commented Sep 22, 2025

🦋 Changeset detected

Latest commit: aa1c903

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@netlify
Copy link

netlify bot commented Sep 22, 2025

Deploy Preview for publicodes-website ready!

Name Link
🔨 Latest commit aa1c903
🔍 Latest deploy log https://app.netlify.com/projects/publicodes-website/deploys/68ecc86e0f420a000841f2d0
😎 Deploy Preview https://deploy-preview-770--publicodes-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 22, 2025

Open in StackBlitz

@publicodes/cli

npm i https://pkg.pr.new/publicodes/publicodes/@publicodes/cli@770

@publicodes/codemod

npm i https://pkg.pr.new/publicodes/publicodes/@publicodes/codemod@770

publicodes

npm i https://pkg.pr.new/publicodes/publicodes@770

@publicodes/forms

npm i https://pkg.pr.new/publicodes/publicodes/@publicodes/forms@770

@publicodes/react-ui

npm i https://pkg.pr.new/publicodes/publicodes/@publicodes/react-ui@770

@publicodes/rest-api

npm i https://pkg.pr.new/publicodes/publicodes/@publicodes/rest-api@770

@publicodes/runtime

npm i https://pkg.pr.new/publicodes/publicodes/@publicodes/runtime@770

@publicodes/tools

npm i https://pkg.pr.new/publicodes/publicodes/@publicodes/tools@770

commit: aa1c903

@johangirod johangirod force-pushed the 2.0 branch 2 times, most recently from 5b4a336 to 5431781 Compare September 22, 2025 12:39
@johangirod johangirod force-pushed the 2.0 branch 12 times, most recently from e193ab0 to 3e07ce0 Compare September 22, 2025 13:56
* feat: Add standard meta in generated output

- Rename parameters to outputs in compiler

fix #773

* feat: only allow authorized key in rule

* feat: add a new codemod for v2 migration
@johangirod johangirod force-pushed the 2.0 branch 2 times, most recently from 31aef23 to d6e12cb Compare October 3, 2025 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants