Commit Graph

91 Commits

Author SHA1 Message Date
Qi Xiao
65508e728f parse: Name chain shift: ErrorEntry -> Error -> MultiError.
The Error type now implements the error interface.
2018-11-19 23:05:05 +00:00
Qi Xiao
980bc4792d parse: Cleanups.
* Unexport the Parser type, and remove an unused field.

* parse.ParseAs -> parse.As; parse.Parse -> parse.AsChunk.
2018-10-13 17:27:39 +01:00
Qi Xiao
fe234ca3ce parse: Remove PPrint{AST,ParseTree}.
PPrint{AST,ParseTree}To have been renamed to PPrint{AST,ParseTree}.
2018-10-13 14:04:13 +01:00
Qi Xiao
bb6d4b320b parse: cleanup test utils. 2018-03-16 23:10:01 +00:00
Qi Xiao
7812b3cc45 parse: Cleanup pprint. 2018-03-16 23:06:23 +00:00
Qi Xiao
472d8fb3fd Use backslash for line continuation.
This is a breaking change. This addresses #583.
2018-02-02 22:03:33 -08:00
Qi Xiao
83b4795783 Support line continuation with backquote.
This fixes #417.
2017-08-13 18:41:36 +01:00
Qi Xiao
fc3ef31eb8 No backquotes for output capture anymore. 2017-08-13 18:41:33 +01:00
Qi Xiao
a48df99361 Parse options in lambda signature. 2017-08-05 21:50:44 +02:00
Qi Xiao
106600a7da Fix misspellings. 2017-05-21 23:57:57 +01:00
Qi Xiao
910610f583 Make golint slightly happier. 2017-05-21 23:54:04 +01:00
Qi Xiao
b9735f3940 Run "gofmt -s". 2017-05-21 23:18:24 +01:00
Qi Xiao
9d9c2a250d PredCapture -> ExceptionCapture 2017-02-18 04:43:27 +00:00
Qi Xiao
052a1a60da Make "if" a special form using curly braces.
Now we have eliminated all control structures. They are now all special forms
instead. Yay!
2017-02-18 04:34:11 +00:00
Qi Xiao
b90f0c776d Make "try" a special form using curly braces. 2017-02-18 04:16:21 +00:00
Qi Xiao
7100ddc9ba Remove the "begin" control structure. 2017-02-18 00:12:21 +00:00
Qi Xiao
31cf0e6ca4 Make "while" a special form using curly braces. 2017-02-18 00:12:18 +00:00
Qi Xiao
01f6302153 Make "for" a special form using curly braces. 2017-02-18 00:12:15 +00:00
Qi Xiao
d8f81f4e30 Let "if" and "while" take values instead of pipelines.
This addresses #319.
2017-02-16 04:10:53 +00:00
Qi Xiao
e1dc20eb3c Call two sides of Assignment and Redir simply Left and Right. 2017-02-13 00:42:00 -05:00
Qi Xiao
916da7de7b Allow arbitrary spaces after = in map pairs.
Use this to pretty-print maps.
2017-02-11 23:23:36 -05:00
Qi Xiao
b7a2e7d0df Add a spacey assignment syntax.
This fixes #294.
2017-02-03 10:06:11 -08:00
Qi Xiao
ee81f0680c Use specific error types for parse, compile and eval.
Generic error types in util are ditched.
2017-01-28 14:39:52 +00:00
Qi Xiao
f549557ef1 parse: Add tests. 2016-10-14 00:26:24 +08:00
Qi Xiao
5dd62563ce Fix test cases. 2016-10-13 23:11:18 +08:00
Qi Xiao
0a77a9b66b Allow newlines in map literals.
This fixes #216.
2016-09-19 16:33:25 +02:00
Qi Xiao
4738967962 Fix the try control structure; add tests. 2016-08-03 20:16:41 +02:00
Qi Xiao
a32294620b Fix test cases. 2016-07-12 22:45:13 +02:00
Qi Xiao
ef5cf8e037 Allow * ^ < > as command names.
This fixes #188.
2016-06-21 15:23:32 +00:00
Qi Xiao
576469edb1 Remove support for ranges in braced lists. 2016-03-16 02:49:37 +01:00
Qi Xiao
a657a2989a parse: Add QuoteAs, move [qQ]uote* to quote.go. 2016-02-24 13:04:28 +01:00
Qi Xiao
8dec0263c6 Allow newlines in more spaces. 2016-02-22 13:44:56 +01:00
Qi Xiao
f102a46833 Parse newlines after pipe and inside lists as oridnary spaces. 2016-02-22 13:26:22 +01:00
Qi Xiao
09b77f6127 parse: Remove unused funcs; test Quote. 2016-02-20 17:05:28 +01:00
Qi Xiao
4cca805a1c parse: Add test cases. 2016-02-20 16:52:24 +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
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
7f58514b37 parse: Test against bogus command leader. 2016-02-17 01:15:13 +01:00
Qi Xiao
5db90fd20f Merge *util packages into an util package. 2016-02-16 19:15:29 +01:00
Qi Xiao
0e981ee6de Preliminary parsing of control structures. 2016-02-14 15:29:00 +01:00
Qi Xiao
4ac2572555 Add a test case against parse.Parse. 2016-02-11 22:59:21 +01:00
Qi Xiao
7603a83a98 Parse tildes; fix highlighting of wildcards. 2016-02-07 14:14:13 +01:00
Qi Xiao
e6bb065d4e Parsing of incomplete maps is now safe. 2016-02-07 00:10:41 +01:00
Qi Xiao
d7bd90e89e parse: Add tests against error reporting. 2016-02-06 13:51:12 +01:00
Qi Xiao
954c75e16e parse_test.go: Top down; comments. 2016-02-06 13:43:28 +01:00
Qi Xiao
4b7746e95a Fix test cases. 2016-02-06 00:43:51 +01:00
Qi Xiao
af9ca8cd14 parse: Order pprint.go top-down; expose pprint{AST,ParseTree} 2016-02-05 23:13:28 +01:00
Qi Xiao
3e0dc9c57b parse and compile argumentless lambdas 2016-02-05 01:04:52 +01:00