Soilihi BEN SOILIHI BOINA pushed to branch soilih at Stefan / Typer
Commits: 91c0bb50 by Soilih BEN SOILIH at 2021-03-13T22:36:05-07:00 commit
- - - - - 74b6b623 by Soilih BEN SOILIH at 2021-03-22T09:15:37-06:00 first commit
- - - - - a4a9cf9e by Soilih BEN SOILIH at 2021-03-26T21:48:38-06:00 fonction readstring
- - - - -
4 changed files:
- + samples/soilih.typer - src/REPL.ml - src/dune - src/typer_lsp_server.ml
Changes:
===================================== samples/soilih.typer ===================================== @@ -0,0 +1 @@ +let a = 3 b = 4 in a + b ; \ No newline at end of file
===================================== src/REPL.ml ===================================== @@ -204,6 +204,12 @@ let help_msg = %help (%h) : print help "
+let readstring (str:string) = + let ectx = Elab.default_ectx in + (*let rctx = Elab.default_rctx in*) + let (list, _) = Elab.lexp_decl_str str ectx in + list +
let readfiles files (i, lctx, rctx) prt = (* Read specified files *) @@ -223,6 +229,7 @@ let readfiles files (i, lctx, rctx) prt = (i, lctx, rctx) files
+ (* Specials commands %[command-name] [args] *) let rec repl i clxp rctx = let repl = repl (i + 1) in @@ -301,8 +308,10 @@ let parse_args () = Arg.parse arg_defs (fun s -> arg_files:= s::!arg_files) ""
let main () = + parse_args (); - if (!lsp_server = true) = true then Typer_lsp_server.run () + + if !lsp_server then Typer_lsp_server.run () else ();
let ectx = Elab.default_ectx in @@ -334,6 +343,5 @@ let main () = if not !arg_batch then (* Initiate REPL. This will allow us to inspect interpreted code *) repl i ectx rctx - - -let _ = main () + +let _ = main ()
===================================== src/dune ===================================== @@ -2,6 +2,8 @@ (executable (name REPL) ;; (public_name typer) - (libraries "zarith" "str" "linol" "linol-lwt" - "lsp" "jsonrpc") + (libraries "zarith" "str" + "linol" "linol-lwt" + "lsp" "jsonrpc" + ) ) \ No newline at end of file
===================================== src/typer_lsp_server.ml ===================================== @@ -43,9 +43,8 @@ type state_after_processing = unit let process_some_input_file (_file_contents : string) : state_after_processing = ()
-let diagnostics (_state : state_after_processing) : Lsp.Types.Diagnostic.t list = - [] - +let diagnostics (_state : state_after_processing ) : Lsp.Types.Diagnostic.t list = + []
(* Lsp server class This is the main point of interaction beetween the code checking documents
View it on GitLab: https://gitlab.com/monnier/typer/-/compare/62dad5517d55bb95270ec9a0e57365d3f...
Afficher les réponses par date