aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNerdyPepper <[email protected]>2019-03-28 02:40:29 +0000
committerNerdyPepper <[email protected]>2019-03-28 02:40:29 +0000
commitb717e52505c4a36424f118073c856f6e565cd7d4 (patch)
tree3472c7f0ec995b33aa26bc0eb0b421b8b4de7b58
parent308aac0af7aa82ea64d8808c022efaa7f4b5d6cb (diff)
feat: run eva in command mode
-rw-r--r--Cargo.lock357
-rw-r--r--src/main.rs83
2 files changed, 49 insertions, 391 deletions
diff --git a/Cargo.lock b/Cargo.lock
deleted file mode 100644
index cb43b18..0000000
--- a/Cargo.lock
+++ /dev/null
@@ -1,357 +0,0 @@
1[[package]]
2name = "argon2rs"
3version = "0.2.5"
4source = "registry+https://github.com/rust-lang/crates.io-index"
5dependencies = [
6 "blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
7 "scoped_threadpool 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
8]
9
10[[package]]
11name = "arrayvec"
12version = "0.4.10"
13source = "registry+https://github.com/rust-lang/crates.io-index"
14dependencies = [
15 "nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
16]
17
18[[package]]
19name = "autocfg"
20version = "0.1.2"
21source = "registry+https://github.com/rust-lang/crates.io-index"
22
23[[package]]
24name = "backtrace"
25version = "0.3.14"
26source = "registry+https://github.com/rust-lang/crates.io-index"
27dependencies = [
28 "autocfg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
29 "backtrace-sys 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)",
30 "cfg-if 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
31 "libc 0.2.50 (registry+https://github.com/rust-lang/crates.io-index)",
32 "rustc-demangle 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
33 "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
34]
35
36[[package]]
37name = "backtrace-sys"
38version = "0.1.28"
39source = "registry+https://github.com/rust-lang/crates.io-index"
40dependencies = [
41 "cc 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)",
42 "libc 0.2.50 (registry+https://github.com/rust-lang/crates.io-index)",
43]
44
45[[package]]
46name = "bitflags"
47version = "1.0.4"
48source = "registry+https://github.com/rust-lang/crates.io-index"
49
50[[package]]
51name = "blake2-rfc"
52version = "0.2.18"
53source = "registry+https://github.com/rust-lang/crates.io-index"
54dependencies = [
55 "arrayvec 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
56 "constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
57]
58
59[[package]]
60name = "cc"
61version = "1.0.31"
62source = "registry+https://github.com/rust-lang/crates.io-index"
63
64[[package]]
65name = "cfg-if"
66version = "0.1.7"
67source = "registry+https://github.com/rust-lang/crates.io-index"
68
69[[package]]
70name = "cloudabi"
71version = "0.0.3"
72source = "registry+https://github.com/rust-lang/crates.io-index"
73dependencies = [
74 "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
75]
76
77[[package]]
78name = "constant_time_eq"
79version = "0.1.3"
80source = "registry+https://github.com/rust-lang/crates.io-index"
81
82[[package]]
83name = "dirs"
84version = "1.0.5"
85source = "registry+https://github.com/rust-lang/crates.io-index"
86dependencies = [
87 "libc 0.2.50 (registry+https://github.com/rust-lang/crates.io-index)",
88 "redox_users 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
89 "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
90]
91
92[[package]]
93name = "eva"
94version = "0.1.0"
95dependencies = [
96 "rustyline 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
97]
98
99[[package]]
100name = "failure"
101version = "0.1.5"
102source = "registry+https://github.com/rust-lang/crates.io-index"
103dependencies = [
104 "backtrace 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
105 "failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
106]
107
108[[package]]
109name = "failure_derive"
110version = "0.1.5"
111source = "registry+https://github.com/rust-lang/crates.io-index"
112dependencies = [
113 "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
114 "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)",
115 "syn 0.15.29 (registry+https://github.com/rust-lang/crates.io-index)",
116 "synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
117]
118
119[[package]]
120name = "fuchsia-cprng"
121version = "0.1.1"
122source = "registry+https://github.com/rust-lang/crates.io-index"
123
124[[package]]
125name = "libc"
126version = "0.2.50"
127source = "registry+https://github.com/rust-lang/crates.io-index"
128
129[[package]]
130name = "log"
131version = "0.4.6"
132source = "registry+https://github.com/rust-lang/crates.io-index"
133dependencies = [
134 "cfg-if 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
135]
136
137[[package]]
138name = "memchr"
139version = "2.2.0"
140source = "registry+https://github.com/rust-lang/crates.io-index"
141
142[[package]]
143name = "nix"
144version = "0.11.0"
145source = "registry+https://github.com/rust-lang/crates.io-index"
146dependencies = [
147 "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
148 "cc 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)",
149 "cfg-if 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
150 "libc 0.2.50 (registry+https://github.com/rust-lang/crates.io-index)",
151 "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
152]
153
154[[package]]
155name = "nodrop"
156version = "0.1.13"
157source = "registry+https://github.com/rust-lang/crates.io-index"
158
159[[package]]
160name = "proc-macro2"
161version = "0.4.27"
162source = "registry+https://github.com/rust-lang/crates.io-index"
163dependencies = [
164 "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
165]
166
167[[package]]
168name = "quote"
169version = "0.6.11"
170source = "registry+https://github.com/rust-lang/crates.io-index"
171dependencies = [
172 "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
173]
174
175[[package]]
176name = "rand_core"
177version = "0.3.1"
178source = "registry+https://github.com/rust-lang/crates.io-index"
179dependencies = [
180 "rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
181]
182
183[[package]]
184name = "rand_core"
185version = "0.4.0"
186source = "registry+https://github.com/rust-lang/crates.io-index"
187
188[[package]]
189name = "rand_os"
190version = "0.1.3"
191source = "registry+https://github.com/rust-lang/crates.io-index"
192dependencies = [
193 "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
194 "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
195 "libc 0.2.50 (registry+https://github.com/rust-lang/crates.io-index)",
196 "rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
197 "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
198 "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
199]
200
201[[package]]
202name = "rdrand"
203version = "0.4.0"
204source = "registry+https://github.com/rust-lang/crates.io-index"
205dependencies = [
206 "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
207]
208
209[[package]]
210name = "redox_syscall"
211version = "0.1.51"
212source = "registry+https://github.com/rust-lang/crates.io-index"
213
214[[package]]
215name = "redox_users"
216version = "0.3.0"
217source = "registry+https://github.com/rust-lang/crates.io-index"
218dependencies = [
219 "argon2rs 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
220 "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
221 "rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
222 "redox_syscall 0.1.51 (registry+https://github.com/rust-lang/crates.io-index)",
223]
224
225[[package]]
226name = "rustc-demangle"
227version = "0.1.13"
228source = "registry+https://github.com/rust-lang/crates.io-index"
229
230[[package]]
231name = "rustyline"
232version = "3.0.0"
233source = "registry+https://github.com/rust-lang/crates.io-index"
234dependencies = [
235 "dirs 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
236 "libc 0.2.50 (registry+https://github.com/rust-lang/crates.io-index)",
237 "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
238 "memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
239 "nix 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
240 "unicode-segmentation 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
241 "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
242 "utf8parse 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
243 "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
244]
245
246[[package]]
247name = "scoped_threadpool"
248version = "0.1.9"
249source = "registry+https://github.com/rust-lang/crates.io-index"
250
251[[package]]
252name = "syn"
253version = "0.15.29"
254source = "registry+https://github.com/rust-lang/crates.io-index"
255dependencies = [
256 "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
257 "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)",
258 "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
259]
260
261[[package]]
262name = "synstructure"
263version = "0.10.1"
264source = "registry+https://github.com/rust-lang/crates.io-index"
265dependencies = [
266 "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
267 "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)",
268 "syn 0.15.29 (registry+https://github.com/rust-lang/crates.io-index)",
269 "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
270]
271
272[[package]]
273name = "unicode-segmentation"
274version = "1.2.1"
275source = "registry+https://github.com/rust-lang/crates.io-index"
276
277[[package]]
278name = "unicode-width"
279version = "0.1.5"
280source = "registry+https://github.com/rust-lang/crates.io-index"
281
282[[package]]
283name = "unicode-xid"
284version = "0.1.0"
285source = "registry+https://github.com/rust-lang/crates.io-index"
286
287[[package]]
288name = "utf8parse"
289version = "0.1.1"
290source = "registry+https://github.com/rust-lang/crates.io-index"
291
292[[package]]
293name = "void"
294version = "1.0.2"
295source = "registry+https://github.com/rust-lang/crates.io-index"
296
297[[package]]
298name = "winapi"
299version = "0.3.6"
300source = "registry+https://github.com/rust-lang/crates.io-index"
301dependencies = [
302 "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
303 "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
304]
305
306[[package]]
307name = "winapi-i686-pc-windows-gnu"
308version = "0.4.0"
309source = "registry+https://github.com/rust-lang/crates.io-index"
310
311[[package]]
312name = "winapi-x86_64-pc-windows-gnu"
313version = "0.4.0"
314source = "registry+https://github.com/rust-lang/crates.io-index"
315
316[metadata]
317"checksum argon2rs 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3f67b0b6a86dae6e67ff4ca2b6201396074996379fba2b92ff649126f37cb392"
318"checksum arrayvec 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "92c7fb76bc8826a8b33b4ee5bb07a247a81e76764ab4d55e8f73e3a4d8808c71"
319"checksum autocfg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a6d640bee2da49f60a4068a7fae53acde8982514ab7bae8b8cea9e88cbcfd799"
320"checksum backtrace 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "cd5a90e2b463010cd0e0ce9a11d4a9d5d58d9f41d4a6ba3dcaf9e68b466e88b4"
321"checksum backtrace-sys 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)" = "797c830ac25ccc92a7f8a7b9862bde440715531514594a6154e3d4a54dd769b6"
322"checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12"
323"checksum blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "5d6d530bdd2d52966a6d03b7a964add7ae1a288d25214066fd4b600f0f796400"
324"checksum cc 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)" = "c9ce8bb087aacff865633f0bd5aeaed910fe2fe55b55f4739527f2e023a2e53d"
325"checksum cfg-if 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "11d43355396e872eefb45ce6342e4374ed7bc2b3a502d1b28e36d6e23c05d1f4"
326"checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f"
327"checksum constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8ff012e225ce166d4422e0e78419d901719760f62ae2b7969ca6b564d1b54a9e"
328"checksum dirs 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3fd78930633bd1c6e35c4b42b1df7b0cbc6bc191146e512bb3bedf243fcc3901"
329"checksum failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "795bd83d3abeb9220f257e597aa0080a508b27533824adf336529648f6abf7e2"
330"checksum failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ea1063915fd7ef4309e222a5a07cf9c319fb9c7836b1f89b85458672dbb127e1"
331"checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba"
332"checksum libc 0.2.50 (registry+https://github.com/rust-lang/crates.io-index)" = "aab692d7759f5cd8c859e169db98ae5b52c924add2af5fbbca11d12fefb567c1"
333"checksum log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6"
334"checksum memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2efc7bc57c883d4a4d6e3246905283d8dae951bb3bd32f49d6ef297f546e1c39"
335"checksum nix 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d37e713a259ff641624b6cb20e3b12b2952313ba36b6823c0f16e6cfd9e5de17"
336"checksum nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9667ddcc6cc8a43afc9b7917599d7216aa09c463919ea32c59ed6cac8bc945"
337"checksum proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)" = "4d317f9caece796be1980837fd5cb3dfec5613ebdb04ad0956deea83ce168915"
338"checksum quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)" = "cdd8e04bd9c52e0342b406469d494fcb033be4bdbe5c606016defbb1681411e1"
339"checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b"
340"checksum rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d0e7a549d590831370895ab7ba4ea0c1b6b011d106b5ff2da6eee112615e6dc0"
341"checksum rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071"
342"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2"
343"checksum redox_syscall 0.1.51 (registry+https://github.com/rust-lang/crates.io-index)" = "423e376fffca3dfa06c9e9790a9ccd282fafb3cc6e6397d01dbf64f9bacc6b85"
344"checksum redox_users 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3fe5204c3a17e97dde73f285d49be585df59ed84b50a872baf416e73b62c3828"
345"checksum rustc-demangle 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "adacaae16d02b6ec37fdc7acfcddf365978de76d1983d3ee22afc260e1ca9619"
346"checksum rustyline 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "eb02ba7748691403057542ee60a1e7688fdfb46bd3bee752b8977537ee003ae2"
347"checksum scoped_threadpool 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "1d51f5df5af43ab3f1360b429fa5e0152ac5ce8c0bd6485cae490332e96846a8"
348"checksum syn 0.15.29 (registry+https://github.com/rust-lang/crates.io-index)" = "1825685f977249735d510a242a6727b46efe914bb67e38d30c071b1b72b1d5c2"
349"checksum synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "73687139bf99285483c96ac0add482c3776528beac1d97d444f6e91f203a2015"
350"checksum unicode-segmentation 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "aa6024fc12ddfd1c6dbc14a80fa2324d4568849869b779f6bd37e5e4c03344d1"
351"checksum unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "882386231c45df4700b275c7ff55b6f3698780a650026380e72dabe76fa46526"
352"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"
353"checksum utf8parse 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8772a4ccbb4e89959023bc5b7cb8623a795caa7092d99f3aa9501b9484d4557d"
354"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
355"checksum winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "92c1eb33641e276cfa214a0522acad57be5c56b10cb348b3c5117db75f3ac4b0"
356"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
357"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
diff --git a/src/main.rs b/src/main.rs
index 4e9a4e9..37b8d04 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,4 +1,5 @@
1use std::f64; 1use std::f64;
2use std::env;
2 3
3mod lex; 4mod lex;
4use crate::lex::*; 5use crate::lex::*;
@@ -11,46 +12,60 @@ use crate::error::{ CalcError, handler };
11 12
12use rustyline::error::ReadlineError; 13use rustyline::error::ReadlineError;
13use rustyline::Editor; 14use rustyline::Editor;
14use rustyline::config::{ Config, Builder, ColorMode, EditMode }; 15use rustyline::config::{ Builder, ColorMode, EditMode };
16
15 17
16fn main() { 18fn main() {
17 let config_builder = Builder::new(); 19 let args: Vec<String> = env::args().collect();
18 let config = config_builder.color_mode(ColorMode::Enabled) 20 if args.len() > 1 {
19 .edit_mode(EditMode::Emacs) 21 let mut expr = String::new();
20 .history_ignore_space(true) 22 for arg in args[1..].iter() {
21 .max_history_size(1000) 23 expr.push_str(&arg[..]);
22 .build(); 24 }
23 let mut rl = Editor::<()>::with_config(config); 25 let evaled = eval_math_expression(&expr[..]);
24 if rl.load_history("history.txt").is_err() { 26 match evaled {
25 println!("No previous history."); 27 Ok(ans) => println!("{}", ans),
26 } 28 Err(e) => handler(e),
29 };
30 } else {
31 let config_builder = Builder::new();
32 let config = config_builder.color_mode(ColorMode::Enabled)
33 .edit_mode(EditMode::Emacs)
34 .history_ignore_space(true)
35 .max_history_size(1000)
36 .build();
37 let mut rl = Editor::<()>::with_config(config);
38 if rl.load_history("history.txt").is_err() {
39 println!("No previous history.");
40 }
27 41
28 loop { 42 loop {
29 let readline = rl.readline("> "); 43 let readline = rl.readline("> ");
30 match readline { 44 match readline {
31 Ok(line) => { 45 Ok(line) => {
32 rl.add_history_entry(line.as_ref()); 46 rl.add_history_entry(line.as_ref());
33 let evaled = eval_math_expression(&line[..]); 47 let evaled = eval_math_expression(&line[..]);
34 match evaled { 48 match evaled {
35 Ok(ans) => println!("{}", ans), 49 Ok(ans) => println!("{}", ans),
36 Err(e) => handler(e), 50 Err(e) => handler(e),
37 }; 51 };
38 }, 52 },
39 Err(ReadlineError::Interrupted) => { 53 Err(ReadlineError::Interrupted) => {
40 println!("CTRL-C"); 54 println!("CTRL-C");
41 break 55 break
42 }, 56 },
43 Err(ReadlineError::Eof) => { 57 Err(ReadlineError::Eof) => {
44 println!("CTRL-D"); 58 println!("CTRL-D");
45 break 59 break
46 }, 60 },
47 Err(err) => { 61 Err(err) => {
48 println!("Error: {:?}", err); 62 println!("Error: {:?}", err);
49 break 63 break
64 }
50 } 65 }
51 } 66 }
67 rl.save_history("history.txt").unwrap();
52 } 68 }
53 rl.save_history("history.txt").unwrap();
54} 69}
55 70
56fn autobalance_parens(input: &str) -> Result<String, CalcError> { 71fn autobalance_parens(input: &str) -> Result<String, CalcError> {