Cheer Xiao
a4cfc41673
Add util.SubstringByRune
2014-09-21 13:22:34 +02:00
Cheer Xiao
37a8fb263e
eval.combineOutputCapture: Return correct type info
2014-09-21 12:54:28 +02:00
Cheer Xiao
412d8b8801
Use string keys for Table at the moment
...
This works around issue #24 .
2014-09-21 00:41:38 +02:00
Cheer Xiao
47f22c64e8
Channel output in interactive mode is supported (again).
...
This is implemented by making ev.ports[1] a hybrid port. Channel outputs are
collected with a goroutine and written to stdout prepended by some fancy
Unicode symbols.
This resolves issue #23 .
2014-09-21 00:32:09 +02:00
Cheer Xiao
a3a7380021
eval: Add test cases
...
Coverage of eval is now 28.0% (was 2.6%).
2014-09-21 00:10:29 +02:00
Cheer Xiao
ed8f84e869
Makefile: Comment service and elvishd packages for now
2014-09-20 23:12:22 +02:00
Cheer Xiao
c51c4e2bec
sys: Add test cases
2014-09-20 23:11:20 +02:00
Cheer Xiao
555b050120
parse: Add many test cases
2014-09-20 22:30:39 +02:00
Cheer Xiao
1511472335
parse/parse.go: Minor fixes
2014-09-20 22:30:28 +02:00
Cheer Xiao
61d720d20f
parse/lex.go: '<' '>' '?' now also terminates a bareword
2014-09-20 21:52:55 +02:00
Cheer Xiao
da87dff8bd
parse: redir is now RedirBase and its members are public
...
This is needed for util.DeepPrint used in test cases.
2014-09-20 21:50:01 +02:00
Cheer Xiao
09faecc159
parse/lex.go: Remove unused funcs
2014-09-20 20:50:43 +02:00
Cheer Xiao
a71327d64c
A lone sigil is now treated as a bareword.
...
Issue #5 is now properly implemented.
2014-09-20 20:34:33 +02:00
Cheer Xiao
0947761b41
Always use ClosureType, not *ClosureType
...
This fixes the issue of user-defined functions never being found.
2014-09-20 19:19:53 +02:00
Cheer Xiao
333f76de74
Implement sigil, as per issue #5 .
...
However due to problems with user-defined functions this can not be tested
reliably yet.
2014-09-20 19:09:23 +02:00
Cheer Xiao
b5758d5cba
parse: Improve comments
2014-09-20 15:29:07 +02:00
Cheer Xiao
403da6a37f
Remove "caret" from the language.
...
Caret is an artifact from rc to support forms like `echo $a ^ b`. Since elvish
supports {the list syntax} this can be written as `echo {$a}b` like in fish.
The operation of compounding primary expressions is now properly called
"compound".
2014-09-20 15:06:16 +02:00
Cheer Xiao
fd5c4f097e
eval: Enrich comments, minor refactors
2014-09-20 01:23:29 +02:00
Cheer Xiao
50958523fb
In combineOutputCapture, don't fiddle with newEv.ports
2014-09-20 00:29:12 +02:00
Cheer Xiao
70152f84c2
Add an informational context member to Evaluator
...
When forking an Evaluator, the context instead of name is changed.
2014-09-19 23:56:38 +02:00
Cheer Xiao
f84a2188db
Merge pull request #32 from neilberget/dockerize
...
Add a Dockerfile
2014-09-19 22:34:44 +02:00
Cheer Xiao
3a281653c9
Fix Evaluator created for output capture.
...
When creating newEv from ev, shouldClose is no longer transferred, and
newEv.closePorts is now correctly called.
This problem resulted in a deadlock when ev corresponds to a form containing
output capture and not the last in the pipeline, since in that case the
output of ev is not correctly closed. In some cases, this only results in a
hanging channel but is not observable otherwise.
This fixes issue #31 .
2014-09-19 09:55:18 +02:00
Cheer Xiao
c97b662434
Remove unused func in test
2014-09-19 00:32:18 +02:00
Cheer Xiao
3b1b417285
Remove Value.Caret
2014-09-17 17:52:07 +02:00
Cheer Xiao
04accbcb70
Remove Type.Caret
2014-09-17 17:48:59 +02:00
Cheer Xiao
51d9f68428
The type of an expression may now contain variadic elements anywhere
2014-09-17 17:45:32 +02:00
Cheer Xiao
bdc1fd6291
Drop Evaluator.errorf, errorfPos -> errorf
2014-09-16 23:08:12 +02:00
Cheer Xiao
14455440ed
Put parse.Pos argument last in combine*, convert another Node -> Pos
2014-09-16 23:06:08 +02:00
Cheer Xiao
b920e51bb1
Drop Evaluator.{nodes push pop}
2014-09-16 23:05:54 +02:00
Cheer Xiao
23d09cb685
Compiler.errorf now takes a Pos. Evaluator.errorfNode -> errorfPos
2014-09-16 22:33:22 +02:00
Cheer Xiao
4624bc5dc4
Enrich comments in parse/parse.go
2014-09-16 21:25:41 +02:00
Cheer Xiao
34ccc00406
Check index range using i < n, not i <= n
2014-09-16 21:15:45 +02:00
Cheer Xiao
613ad85a96
Introduce Subscript between Compound and Primary
...
Subscription is no longer implemented as caret. As a result,
`set $a table = [foo]; echo bar$a[0]` now works as expected.
2014-09-16 21:12:46 +02:00
Cheer Xiao
2451dc0cf9
A term is now a compound expression. A term list is now a spaced expression.
2014-09-16 17:57:33 +02:00
Cheer Xiao
319e2d9274
A factor is now called a primary expression.
2014-09-04 17:17:10 +02:00
Cheer Xiao
a3c8ed4876
Instead of specialized parse.Context, just use the incomplete parse tree
2014-08-22 09:12:18 +02:00
Cheer Xiao
866632698c
More sample scripts
2014-07-30 17:19:11 +08:00
Cheer Xiao
34db921d1a
eval: When indexing tables, check for bad index
...
This still leaves issue #24 unresolved.
2014-07-30 17:04:37 +08:00
Cheer Xiao
9c1a6fb638
main.go: Don't assume Evaluator.Eval returns ContextualError
2014-07-30 17:02:42 +08:00
Neil Berget
14971ed984
Adding a Dockerfile
...
Provides an easy to use sandbox to try elvish:
docker build -t elvish .
docker run -i -t elvish
2014-07-29 21:12:39 -07:00
Cheer Xiao
776c1b3824
edit: SIGINT should not reset editorState.savedTermios
...
This resolves issue #29 .
2014-07-29 10:30:47 +08:00
Cheer Xiao
ce7dcebb1c
edit: Update an outdated comment
2014-07-29 10:25:22 +08:00
Cheer Xiao
86972931ff
Capture screenshots with subpixel AA turned off
2014-07-28 11:28:43 +08:00
Cheer Xiao
4df2d059d3
README: There is no TODO.md anymore
2014-07-27 10:59:16 +08:00
Cheer Xiao
93a3272c53
README: Link to AUR package
2014-07-27 10:56:06 +08:00
Cheer Xiao
50fd53f5c5
README: Call nested func call applicative instead of functional
2014-07-27 10:53:46 +08:00
Cheer Xiao
52832271ac
Add sample-scripts
2014-07-19 19:39:50 +08:00
Cheer Xiao
efc9fd70af
Ensure types of lhs and rhs match in var and set forms
2014-07-19 16:53:31 +08:00
Cheer Xiao
5d65bd6324
eval: s/Checker/Compiler/g
2014-07-16 15:43:00 +08:00
Cheer Xiao
f690210088
eval: fix a format string
2014-07-16 15:42:05 +08:00