summaryrefslogtreecommitdiff
path: root/src/process_file.ml
diff options
context:
space:
mode:
authorAlasdair Armstrong2018-04-04 15:03:45 +0100
committerAlasdair Armstrong2018-04-05 18:40:36 +0100
commit3604e9e94b766147b482c4c653c4d09bb4ee7a7c (patch)
tree75ea0e29a1f16d96140d5e100292923df5a8fa2e /src/process_file.ml
parent252460bc33fc26d8ef8aa905592fd4029d97d419 (diff)
Add generic prelude library that pulls in various basic sail
definitions from sail/lib.
Diffstat (limited to 'src/process_file.ml')
-rw-r--r--src/process_file.ml7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/process_file.ml b/src/process_file.ml
index 3f24f4c3..88220841 100644
--- a/src/process_file.ml
+++ b/src/process_file.ml
@@ -162,6 +162,13 @@ let rec preprocess = function
| Parse_ast.DEF_pragma (p, arg, _) :: defs ->
(Util.warn ("Bad pragma $" ^ p ^ " " ^ arg); preprocess defs)
+ | (Parse_ast.DEF_default (Parse_ast.DT_aux (Parse_ast.DT_order (_, Parse_ast.ATyp_aux (atyp, _)), _)) as def) :: defs ->
+ begin match atyp with
+ | Parse_ast.ATyp_inc -> symbols := StringSet.add "_DEFAULT_INC" !symbols; def :: preprocess defs
+ | Parse_ast.ATyp_dec -> symbols := StringSet.add "_DEFAULT_DEC" !symbols; def :: preprocess defs
+ | _ -> def :: preprocess defs
+ end
+
| def :: defs -> def :: preprocess defs
let preprocess_ast (Parse_ast.Defs defs) = Parse_ast.Defs (preprocess defs)