summaryrefslogtreecommitdiff
path: root/src/initial_check.ml
diff options
context:
space:
mode:
authorAlasdair Armstrong2019-03-14 17:27:07 +0000
committerAlasdair Armstrong2019-03-14 18:04:55 +0000
commitc741e731afe4a6d2c65d43ca299a1a48a1534ec0 (patch)
treeed5173a9017783da456ba69a83258df42f47c57e /src/initial_check.ml
parentd6690cce7569c1438f14e187a28f8139255c4e19 (diff)
Add various useful methods to interactive mode
:def <definition> evaluates a top-level definition :(b)ind <id> : <type> creates an identifier within the interactive type-checking environment :let <id> = <expression> defines an identifier Using :def the following now works and brings the correct vector operations into scope. :def default Order dec :load lib/prelude.sail Also fix a type-variable shadowing bug
Diffstat (limited to 'src/initial_check.ml')
-rw-r--r--src/initial_check.ml4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/initial_check.ml b/src/initial_check.ml
index b3d24820..691acd81 100644
--- a/src/initial_check.ml
+++ b/src/initial_check.ml
@@ -1036,6 +1036,10 @@ let process_ast ?generate:(generate=true) defs =
else
ast
+let ast_of_def_string_with f str =
+ let def = Parser.def_eof Lexer.token (Lexing.from_string str) in
+ process_ast (f (P.Defs [def]))
+
let ast_of_def_string str =
let def = Parser.def_eof Lexer.token (Lexing.from_string str) in
process_ast (P.Defs [def])