aboutsummaryrefslogtreecommitdiff
path: root/src/main.ml
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.ml')
-rwxr-xr-xsrc/main.ml11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main.ml b/src/main.ml
index 3b83e85..4491025 100755
--- a/src/main.ml
+++ b/src/main.ml
@@ -55,9 +55,12 @@ let f screen = ActionParser.(
| _ -> raise Not_found
end)
+let menhirParser =
+ MenhirLib.Convert.Simplified.traditional2revised ActionParser.normal
+
let parser screen = begin
let get_value () = f screen, Lexing.dummy_pos, Lexing.dummy_pos in
- MenhirLib.Convert.Simplified.traditional2revised ActionParser.normal get_value
+ menhirParser get_value
end
let rec normal_mode (t, screen) = begin
@@ -215,12 +218,14 @@ and command (t, screen) action = begin
| ("w", file) -> (* Save the file *)
Odf.save t.Sheet.data file;
normal_mode @@ redraw t screen
+(*
| ("repr", file) -> (* Save the file *)
let out_gv = open_out_bin file in
let form = Format.formatter_of_out_channel out_gv in
Evaluator.repr form (Evaluator.get_catalog ());
close_out out_gv;
normal_mode @@ redraw t screen
+*)
| ("enew", _) -> (* Start a new spreadsheet *)
normal_mode @@ redraw (Sheet.create Sheet.Raw.empty) screen
| ("q", _) -> (* Quit *)
@@ -230,6 +235,10 @@ end
let () = begin
+ let catalog = Functions.built_in Functions.C.empty in
+ ignore @@ Evaluator.set_catalog (Functions.C.compile catalog);
+
+
let sheet =
if Array.length Sys.argv = 1 then
Sheet.Raw.empty