summaryrefslogtreecommitdiff
path: root/src/initial_check.ml
diff options
context:
space:
mode:
authorAlasdair2019-02-06 23:08:48 +0000
committerAlasdair2019-02-06 23:08:48 +0000
commitddaf05544d182bd75471ce307458daf417c9e17f (patch)
treed3101591badba8b943c9ffd1e06189387f713386 /src/initial_check.ml
parentcd6466eef8a7cb878010f5d9c6f6349606393bb1 (diff)
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.
Diffstat (limited to 'src/initial_check.ml')
-rw-r--r--src/initial_check.ml14
1 files changed, 8 insertions, 6 deletions
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])