Commit Graph

88 Commits

Author SHA1 Message Date
JT
143855b662
Add better comment skipping (#359) 2021-11-22 07:13:09 +13:00
Jakub Žádník
5459d30a24
Add environment variable support for modules (#331)
* Add 'expor env' dummy command

* (WIP) Abstract away module exportables as Overlay

* Switch to Overlays for use/hide

Works for decls only right now.

* Fix passing import patterns of hide to eval

* Simplify use/hide of decls

* Add ImportPattern as Expr; Add use env eval

Still no parsing of "export env" so I can't test it yet.

* Refactor export parsing; Add InternalError

* Add env var export and activation; Misc changes

Now it is possible to `use` env var that was exported from a module.

This commit also adds some new errors and other small changes.

* Add env var hiding

* Fix eval not recognizing hidden decls

Without this change, calling `hide foo`, the evaluator does not know
whether a custom command named "foo" was hidden during parsing,
therefore, it is not possible to reliably throw an error about the "foo"
name not found.

* Add use/hide/export env var tests; Cleanup; Notes

* Ignore hide env related tests for now

* Fix main branch merge mess

* Fixed multi-word export def

* Fix hiding tests on Windows

* Remove env var hiding for now
2021-11-16 12:16:06 +13:00
JT
be827e5628
Fix multiword imports/exports (#336) 2021-11-15 08:40:26 +13:00
JT
0f107b2830
Add a config variable with engine support (#332)
* Add a config variable with engine support

* Add a config variable with engine support

* Oops, cleanup
2021-11-15 08:25:57 +13:00
JT
568e566adf
Add record literal syntax (#326) 2021-11-11 12:14:00 +13:00
JT
066afb059e
Add magic in variable, part 2 (#310) 2021-11-08 20:13:55 +13:00
JT
e9a7def183
Add magic $in variable (#309)
* Add magic in variable

* Oops, missing file
2021-11-08 19:21:24 +13:00
JT
b5bade6187
Let list and table exprs get indexed (#307) 2021-11-08 12:18:00 +13:00
JT
19645575d6
Add 'did you mean' error (#305) 2021-11-08 10:48:50 +13:00
JT
00a8752c76
Move where to helper (#302) 2021-11-07 15:40:44 +13:00
JT
6c31377c21
Fix precedence parse (#298) 2021-11-06 20:31:28 +13:00
JT
d401ed64ed
Add range to the math reductions (#296) 2021-11-06 20:12:08 +13:00
JT
183d200b9f Add updating cell paths 2021-11-05 16:59:12 +13:00
JT
1949ba080e Add env shorthand 2021-11-04 15:32:35 +13:00
JT
25846d3c1e Add zip command 2021-11-02 18:28:28 +13:00
JT
d856cebebd Add a simple scope variable 2021-11-02 16:08:05 +13:00
Jakub Žádník
b340672331 Remove leftover test from previous iteration 2021-10-31 18:01:15 +02:00
Jakub Žádník
b7c0ba104f Fix hiding module; Fmt
This fixes the case when you call `hide spam`. It will now hide all
commands you'd call like `spam foo` etc.
2021-10-31 17:38:00 +02:00
Jakub Žádník
2dcfecbbd7 Add test for multi-word alias 2021-10-29 23:57:33 +03:00
Jakub Žádník
bd6c550470 Change import pattern delimiter to space
Subcommands and module imports will have the same syntax now.
2021-10-27 00:13:39 +03:00
Jakub Žádník
595fc7a7f6 Switch to cross-platform fail message 2021-10-26 21:03:12 +03:00
Jakub Žádník
402a4acd7a Fix leftover test 2021-10-26 21:03:12 +03:00
Jakub Žádník
5163dbb7a1 Add tests and cover edge cases of the :: delim. 2021-10-26 21:03:12 +03:00
Jakub Žádník
cbda1b1650 Change import pattern delimiter to :: 2021-10-26 21:03:12 +03:00
JT
5455270446 Add a simple parallel each 2021-10-26 14:30:53 +13:00
JT
4be61ce604 Tests pass 2021-10-26 11:18:45 +13:00
JT
fdd2c35fd9 Add the default help flag 2021-10-14 06:53:27 +13:00
JT
aea8627c30 Prevent invalid var names 2021-10-12 18:08:55 +13:00
JT
5f14faf4b4 Custom switch support 2021-10-12 17:49:17 +13:00
JT
c8277a3da9 Do rest args 2021-10-12 16:28:39 +13:00
JT
96419f168b Also fix the flag params 2021-10-12 10:17:45 +13:00
JT
1f45304cf9 Fix parser when def has missing params 2021-10-12 09:58:38 +13:00
JT
63e3552eef Add the remaining missing operators 2021-10-12 09:35:12 +13:00
JT
0d031636a9 Error on missing column during cell path 2021-10-12 08:55:14 +13:00
JT
576471cc3c Fix test 2021-10-12 08:33:09 +13:00
Jakub Žádník
77c520e10b Make predeclarations scoped; Add hiding tests
In some rare cases, the global predeclarations would clash, for example:

  > module spam { export def foo [] { "foo" } }; def foo [] { "bar" }

In the example, the `foo [] { "bar" }` would get predeclared first, then
the predeclaration would be overwritten and consumed by `foo [] {"foo"}`
inside the module, then when parsing the actual `foo [] { "bar" }`, it
would not find its predeclaration.
2021-10-10 14:31:13 +03:00
Arthur Targaryen
d5fdfdb614 Add missing test attribute 2021-10-09 19:40:47 +02:00
Arthur Targaryen
9e7e8ed48f Handle not-in operator 2021-10-09 19:40:47 +02:00
Arthur Targaryen
7f06d6144f Support in operator for record and value stream 2021-10-09 19:27:54 +02:00
Arthur Targaryen
d3bc096d47 Handle reverse ranges
This is really ugly and should be refactored.
2021-10-09 19:27:54 +02:00
Arthur Targaryen
8783cf0138 Add basic in operator support 2021-10-09 19:27:54 +02:00
JT
5d36d37d20 Merge branch 'main' into fix_for 2021-10-10 05:20:50 +13:00
JT
e4ce41ba15 Fix the for loop to create vars 2021-10-10 05:10:46 +13:00
Fernando Herrera
a1bfa2788c not found message for windows 2021-10-09 16:44:45 +01:00
JT
5c29a83a7a Add tests 2021-10-09 15:45:25 +13:00
Jakub Žádník
1e1e12b027 Fmt 2021-10-04 22:17:18 +03:00
Jakub Žádník
0fe525de87 Add test with TODO note 2021-10-04 20:16:43 +03:00
Jakub Žádník
4dacfaa44a Add import pattern support to 'hide' 2021-10-04 20:08:24 +03:00
JT
eba3484611
Update tests.rs 2021-10-03 06:17:51 +13:00
JT
0cc121876b
Update tests.rs
Update test errors to be more portable
2021-10-03 06:12:05 +13:00