aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dcl/parser.ml
diff options
context:
space:
mode:
authorMarcos Magueta <maguetamarcos@gmail.com>2026-03-14 11:39:04 -0300
committerGitHub <noreply@github.com>2026-03-14 11:39:04 -0300
commite6661bfa6a3d7dc477d0b7717c80bd536eca2d68 (patch)
tree12510963feeed03221defa690e73edd4135b65e1 /lib/dcl/parser.ml
parent0ad04e638baa8f283150d3c2809cdb9bf21e2995 (diff)
downloadSakura-e6661bfa6a3d7dc477d0b7717c80bd536eca2d68.tar.gz
Sakura-e6661bfa6a3d7dc477d0b7717c80bd536eca2d68.zip
Branching and naïve merge strategies
* AGPL license * branching and merging * Delete LICENSE in favor of separate PR Signed-off-by: Marcos Magueta <maguetamarcos@gmail.com> * add unmonitored tests and docs --------- Signed-off-by: Marcos Magueta <maguetamarcos@gmail.com>
Diffstat (limited to '')
-rw-r--r--lib/dcl/parser.ml8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/dcl/parser.ml b/lib/dcl/parser.ml
index a7981c0..3caf748 100644
--- a/lib/dcl/parser.ml
+++ b/lib/dcl/parser.ml
@@ -1,7 +1,13 @@
type error = ParseError of string
let of_string s =
- match Sexplib.Sexp.of_string s |> Ast.statement_of_sexp with
+ (* ppx_sexp_conv encodes no-argument variants as bare atoms, so
+ unwrap a single-element list (e.g. (GetHead)) → atom (GetHead). *)
+ let sexp = match Sexplib.Sexp.of_string s with
+ | Sexplib.Sexp.List [atom] -> atom
+ | other -> other
+ in
+ match Ast.statement_of_sexp sexp with
| stmt -> Ok stmt
| exception exn -> Error (ParseError (Printexc.to_string exn))