Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions lib/ligo_parser_lib/LowAPI.ml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ module type PARSER =

module Recovery :
sig
include Merlin_recovery.RECOVERY_GENERATED
include MenhirRecoveryLib.RECOVERY_GENERATED
with module I := MenhirInterpreter

val default_value : Region.t -> 'a MenhirInterpreter.symbol -> 'a
Expand Down Expand Up @@ -459,10 +459,10 @@ module Make (Lexer : LEXER)
in List.iter ~f:print lexemes
end

module type PRINTER = Merlin_recovery.PRINTER with module I = Inter
module type PRINTER = MenhirRecoveryLib.PRINTER with module I = Inter

module TracingPrinter : PRINTER =
Merlin_recovery.MakePrinter (EltPrinter)
MenhirRecoveryLib.MakePrinter (EltPrinter)

let checkpoint_to_string = function
Inter.InputNeeded _ -> "InputNeeded"
Expand All @@ -472,7 +472,7 @@ module Make (Lexer : LEXER)
| Inter.HandlingError _ -> "HandlingError"
| Inter.Shifting _ -> "Shifting"

module RecoverWithDefault =
module RecoverWithDefault : MenhirRecoveryLib.RECOVERY with module I := Inter =
struct
include Parser.Recovery

Expand All @@ -499,9 +499,10 @@ module Make (Lexer : LEXER)
let guide _ = false

let use_indentation_heuristic = false
let is_eof = Lexer.Token.is_eof
end

module R = Merlin_recovery.Make
module R = MenhirRecoveryLib.Make
(Inter) (RecoverWithDefault) (TracingPrinter)

module Recover =
Expand Down
2 changes: 1 addition & 1 deletion lib/ligo_parser_lib/LowAPI.mli
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ module type PARSER =

module Recovery :
sig
include Merlin_recovery.RECOVERY_GENERATED
include MenhirRecoveryLib.RECOVERY_GENERATED
with module I := MenhirInterpreter

val default_value : Region.t -> 'a MenhirInterpreter.symbol -> 'a
Expand Down
3 changes: 2 additions & 1 deletion lib/ligo_parser_lib/dune
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
Preprocessor
LexerLib
GetoptLib
ocaml-recovery-parser
ocaml-recovery-parser.custom_compiler_libs
ocaml-recovery-parser.menhirRecoveryLib
;; Third party
core_kernel.nonempty_list
menhirLib))
Expand Down
19 changes: 19 additions & 0 deletions nix/overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,26 @@ with prev; {
buildInputs = [jsonm ppx_sexp_conv];
propagatedBuildInputs = [base64 re stringext uri-sexp];
};
ocaml-recovery-parser = buildDunePackage
rec {
pname = "ocaml-recovery-parser";
version = "0.3.0";

duneVersion = "3";

src = fetchFromGitHub {
owner = "serokell";
repo = pname;
rev = version;
sha256 = "sha256-RFRI7VoHd7GceIQnzN1FQYfR/5nbrU/t1pLTbURE6PY=";
};

propagatedBuildInputs = [
fix
menhirLib
menhirSdk
];
};
grace = buildDunePackage rec {
pname = "grace";
version = "0.0.2";
Expand Down
2 changes: 1 addition & 1 deletion src/passes/02-parsing/cameligo/dune
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
(with-stdout-to
%{targets}
(run
menhir-recover
ocaml-recovery-parser.menhir-recovery-generator
--external-tokens
Lexing_cameligo.Token.MenhirInterpreter
Parser.cmly))))
Expand Down
2 changes: 1 addition & 1 deletion src/passes/02-parsing/jsligo/dune
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
(with-stdout-to
%{targets}
(run
menhir-recover
ocaml-recovery-parser.menhir-recovery-generator
--external-tokens
Lexing_jsligo.Token.MenhirInterpreter
Parser.cmly))))
Expand Down
2 changes: 1 addition & 1 deletion src/passes/02-parsing/shared/Common.ml
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ module type LIGO_PARSER =

module Recovery :
sig
include Merlin_recovery.RECOVERY_GENERATED
include MenhirRecoveryLib.RECOVERY_GENERATED
with module I := MenhirInterpreter

val default_value : Region.t -> 'a MenhirInterpreter.symbol -> 'a
Expand Down
2 changes: 1 addition & 1 deletion src/passes/02-parsing/shared/Common.mli
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ module type LIGO_PARSER =

module Recovery :
sig
include Merlin_recovery.RECOVERY_GENERATED
include MenhirRecoveryLib.RECOVERY_GENERATED
with module I := MenhirInterpreter

val default_value : Region.t -> 'a MenhirInterpreter.symbol -> 'a
Expand Down
2 changes: 1 addition & 1 deletion src/test/error-recovery/error_recovery.ml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ end

module RecoveryType (MenhirInterpreter : MenhirLib.IncrementalEngine.EVERYTHING) = struct
module type RecoverParser = sig
include Merlin_recovery.RECOVERY_GENERATED with module I := MenhirInterpreter
include MenhirRecoveryLib.RECOVERY_GENERATED with module I := MenhirInterpreter

val default_value : Simple_utils.Region.t -> 'a MenhirInterpreter.symbol -> 'a
end
Expand Down