From ddaf05544d182bd75471ce307458daf417c9e17f Mon Sep 17 00:00:00 2001 From: Alasdair Date: Wed, 6 Feb 2019 23:08:48 +0000 Subject: Emacs mode understands relationships between Sail files Allow a file sail.json in the same directory as the sail source file which contains the ordering and options needed for sail files involved in a specific ISA definition. I have an example for v8.5 in sail-arm. The interactive Sail process running within emacs then knows about the relationship between Sail files, so C-c C-l works for files in the ARM spec. Also added a C-c C-x command to jump to a type error. Requires yojson library to build interactive Sail. --- src/initial_check.ml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/initial_check.ml') diff --git a/src/initial_check.ml b/src/initial_check.ml index ae65f13d..d08ab8cf 100644 --- a/src/initial_check.ml +++ b/src/initial_check.ml @@ -1010,18 +1010,20 @@ let generate_enum_functions vs_ids (Defs defs) = let incremental_ctx = ref initial_ctx -let process_ast order defs = +let process_ast ?generate:(generate=true) defs = let ast, ctx = to_ast !incremental_ctx defs in incremental_ctx := ctx; let vs_ids = val_spec_ids ast in - if not !opt_undefined_gen then + if not !opt_undefined_gen && generate then generate_enum_functions vs_ids ast - else + else if generate then ast |> generate_undefineds vs_ids |> generate_enum_functions vs_ids |> generate_initialize_registers vs_ids - -let ast_of_def_string order str = + else + ast + +let ast_of_def_string str = let def = Parser.def_eof Lexer.token (Lexing.from_string str) in - process_ast order (P.Defs [def]) + process_ast (P.Defs [def]) -- cgit v1.2.3