This project adheres to Semantic Versioning. Lines marked with 🧨 describe breaking changes.
🧨 Removed the functor interface, the parser is a single function taking two functions and a stream of terms as parameters.
No more table type needed, the parser only needs a function is_op to distinguish operators from other tokens.
To port code, any snippet like
module S : SUPPORT = struct
type term = ...
type table = ...
let get tbl t = ...
let make_appl t u = ...
end
module P = Pratter.Make(S)should be replaced by
let is_op t = ...
let appl t u = ...where the following properties hold
appl = S.make_appl∃ tbl : S.table, get tbl = is_opUnder these assumptions, denoting tbl the value that makes the second hypothesis hold, we have P.expression tbl = Pratter.expression ~is_op ~appl
t ::= t t | t + t | - t | t * t | t = t | t !Una constructor changed to PrefixBin constructor changed to Infix🧨 Errors are encoded with a polymorphic variant rather than exceptions. To port code, replace sections of the form
try let t = SupPrat.expression tbl s in e with
| ... -> ...with
match SupPrat.expression tbl s with
| Ok t -> e
| Error ... -> ...camlp-streams (because Stdlib.Stream becomes deprecated in OCaml 4.14).Stream.Failure)get for operators in APImake_appl does not use the table of operators