Commit Graph

1579 Commits

Author SHA1 Message Date
Qi Xiao
a1a495cc09 parse: Fix go:generate line. 2016-02-20 17:10:31 +01:00
Qi Xiao
09b77f6127 parse: Remove unused funcs; test Quote. 2016-02-20 17:05:28 +01:00
Qi Xiao
5a1fbf814b Remove an used func. 2016-02-20 16:54:24 +01:00
Qi Xiao
4cca805a1c parse: Add test cases. 2016-02-20 16:52:24 +01:00
Qi Xiao
3cc9f757b1 Merge pull request #149 from Zirak/master
edit: Fix crash in history listing mode
2016-02-20 16:30:19 +01:00
Qi Xiao
2dba0c4b53 parse: Test parsing of control structures. 2016-02-20 15:34:31 +01:00
Qi Xiao
618d927605 parse: Check all fields of AST. 2016-02-20 15:17:34 +01:00
Qi Xiao
935bfd24e7 parse: Move checkAST into a seprate file, add doc. 2016-02-20 14:44:44 +01:00
Zirak
bf64621b7e edit: Fix crash in history listing mode
When you had too few history entries to display in the terminal,
entering history listing mode attempted to access a negative index and
crashed.
2016-02-20 12:31:47 +00:00
Qi Xiao
f407db7283 eval: Use location information in {,Values}Op.
This also fixes a NullPointerException.
2016-02-20 12:25:51 +01:00
Qi Xiao
91fc4a3419 each now takes any CallerValue. 2016-02-20 03:44:08 +01:00
Qi Xiao
83b214e31c edit: When doing a refresh, erase just once in the beginning.
Previously if you bind `le:binding[insert][Ctrl-L] = { put * }`, there is a
small defect that is readily observed by pressing Ctrl-L repeatedly:
the prompt will never go to the bottom of terminal, but always kept one line
higher than the bottom.

This is because invoking a closure from the editor causes a full refresh,
which in turn causes an erase to be done near the end of writer.refresh,
which, in the old algorithm, always adds a superfluous newline.

By doing the erase at the very beginning, we avoid the superfluous newline.
Now pressing Ctrl-L repeatedly will push the prompt to the bottom.
2016-02-20 03:05:03 +01:00
Qi Xiao
6f21bc690f Go back to mattn/go-sqlite3. 2016-02-20 03:04:44 +01:00
Qi Xiao
5c03407a8a Wait for store jobs to finish when exiting.
This fixes #144 #147.
2016-02-20 02:32:12 +01:00
Qi Xiao
098965cfac Also close the database.
Doesn't help with #147 though.
2016-02-20 02:27:26 +01:00
Qi Xiao
3c75e71a8b Use a fork of mxk/go-sqlite. 2016-02-20 01:47:40 +01:00
Qi Xiao
8cb35dfafc Fix a NullPointerException. 2016-02-20 01:37:38 +01:00
Qi Xiao
8900e57707 Switch to mxk/go-sqlite for the SQLite3 backend.
This one has the advantage of supporting SQLite3-specific operations.
2016-02-20 01:22:22 +01:00
Qi Xiao
169b9917e3 Refine evaler's error reporting. 2016-02-20 00:48:13 +01:00
Qi Xiao
2b1b57f0aa Refine compiler's error reporting. 2016-02-19 21:16:23 +01:00
Qi Xiao
b2dbfaee39 Sort variables in completion. 2016-02-19 20:54:40 +01:00
Qi Xiao
7502b61b3e Don't style variables in completion menu. 2016-02-19 20:51:08 +01:00
Qi Xiao
d6a126946c Fix an error message. 2016-02-19 20:49:48 +01:00
Qi Xiao
2e08ae0975 Implement setting of variables in other modules correctly.
This fixes #141.
2016-02-19 20:39:22 +01:00
Qi Xiao
2cdbf67147 Slightly simplify Repr. 2016-02-19 20:31:54 +01:00
Qi Xiao
2413edcc09 Implement pretty printing.
This fixes #112.
2016-02-19 20:11:31 +01:00
Qi Xiao
07b0fc647c Split Value.Kind to Kinder 2016-02-19 18:59:32 +01:00
Qi Xiao
7efeb9c56f Remove ContextualError. 2016-02-19 17:46:21 +01:00
Qi Xiao
be3b938bcf The compiler no longer takes name and source. 2016-02-19 17:33:55 +01:00
Qi Xiao
9a2c30dd3e edit: Don't show tips when about to exit ReadLine. 2016-02-19 17:26:44 +01:00
Qi Xiao
f2b9276b35 eval: Split compile.go. 2016-02-19 17:21:51 +01:00
Qi Xiao
4b60877083 Write directory history in another goroutine. 2016-02-19 15:36:14 +01:00
Qi Xiao
5f3f438193 Guard access to EnvPathList with a RWMutex. 2016-02-19 14:26:14 +01:00
Qi Xiao
17ae71b36c Change the syntax of pairs to use = to separate key and value.
This resolves #136.
2016-02-19 13:58:49 +01:00
Qi Xiao
65a0ab4e83 eval: Introduce a MapLike interface. 2016-02-19 12:21:55 +01:00
Qi Xiao
50af039e16 Introduce a ListLike interface, let *EnvPathList implement it.
All embedded Value's have been removed from the interfaces in edit/value.go.
2016-02-19 12:19:19 +01:00
Qi Xiao
3d7e5a819f Introduce an Elemser interface. 2016-02-19 12:07:38 +01:00
Qi Xiao
83cbe3b230 Introduce a Lener interface. 2016-02-19 11:49:19 +01:00
Qi Xiao
2ac73b4eba Implement two-way syncing between $env:PATH and $paths. 2016-02-19 02:12:10 +01:00
Qi Xiao
4ca7fbca03 Move the "contributing" section to a shiny CONTRIBUTING.md file 2016-02-19 00:13:35 +01:00
Qi Xiao
e6a9e79ea0 Restructure the eval package. 2016-02-18 22:52:05 +01:00
Qi Xiao
c2a3e78d5f Fix Repr of empty list. 2016-02-18 19:42:06 +01:00
Qi Xiao
cc412f8684 Syncing from $env:PATH to $paths and ev.searchPaths.
This addresses #139.
2016-02-18 19:30:08 +01:00
Qi Xiao
ce4d6ff7f2 Disable a test failing on OS X. 2016-02-17 01:53:10 +01:00
Qi Xiao
be3ca4d050 Use "ls -A" to test against RootNames. 2016-02-17 01:47:44 +01:00
Qi Xiao
eebb759edb Fully cover util/exception.go. 2016-02-17 01:43:58 +01:00
Qi Xiao
31fb99daa7 Test against util.RootNames. 2016-02-17 01:41:00 +01:00
Qi Xiao
81422c1f70 Fix an incomplete database. 2016-02-17 01:40:46 +01:00
Qi Xiao
284b99c858 Fully cover util/strings.go. 2016-02-17 01:32:52 +01:00
Qi Xiao
7cb9a9496e util: Test Getwd thoroughly. 2016-02-17 01:27:51 +01:00