125 Commits

Author SHA1 Message Date
eaa3e84179 FIX: Treat is as a regular binary operator
do syntax checks post parse. Also to avoid collisions with
keywords require quoting the types.
2019-01-19 10:49:33 -06:00
1dba5f66ce FEATURE: map, filter, and reduce over lists. 2019-01-18 20:01:08 -06:00
25d84a771e FEATURE: Add the is operator
This operator tests that something is of a certain base type.
2019-01-18 18:47:11 -06:00
d40e89fea9 FEATURE: Boolean Operators. 2019-01-17 19:20:01 -06:00
890387b4cc FEATURE: Macros are just an expression now.
This is a breaking change for the map, filter, and reduce expressions
but happily a forward compatible change for macros themselves.
2019-01-16 19:27:58 -06:00
5b05405618 FIX: presence checks for tuples with NULL values works now. 2019-01-15 18:51:35 -06:00
685ee7407e FEATURE: make macros close over their environment.
The benefits are great enough to allow this and the benefits of
not allowing closures are not terribly useful.

We do not get the same benefits for modules though so we don't add
it to them.
2019-01-14 18:23:39 -06:00
38fc521e3e FIX: The in memory asset cache should no longer canonicalize.
The pseudo relative paths for std libraries won't work with them.
2019-01-13 22:05:20 -06:00
547c271aa1 FEATURE: Special case the std/ import prefix.
It's a reserved import path for our std library.

closes #27
2019-01-13 20:35:23 -06:00
50a3d33208 FEATURE: Generate a hashmap of path to String for std libraries.
prework for #27
2019-01-13 20:34:50 -06:00
c4505ac2ab FEATURE: Add a counter for our assertion output per file. 2019-01-13 14:20:08 -06:00
54faeede5e FEATURE: Imports as expressions.
This is a breaking change for the language. However it makes a number of things
easier. Like importing specific symbols from a file.

adds: #28
2019-01-13 14:10:43 -06:00
0f7498884a FEATURE: No longer require the dsl to output ok vs not ok. 2019-01-13 13:53:24 -06:00
6f9ba2ac33 FEATURE: Add the range expression.
fixes: #24
2019-01-10 19:40:32 -06:00
d989e47706 FEATURE: Use a better DSL for unit tests.
* Assert now requires a tuple instead of a string containing
  statements.
* We include a helpful ucg based unit testing module.

Fixes: #26
2019-01-10 17:17:57 -06:00
83a641e740 FEATURE: Add regular expression comparison operators. 2019-01-07 19:38:25 -06:00
e46496c666 FEATURE: Add a reduce operator for lists and tuples.
fixes #19
fixes #21
2019-01-06 20:57:37 -06:00
a8c4ce1157 FEATURE: Allow map and filter on tuples. 2019-01-06 16:35:35 -06:00
ef01f166b2 REFACTOR: Add a little more abstraction for map and filter.
* Clearer and easier to follow code.
* Smaller functions.
* Easier to add future functionality.
2019-01-06 15:45:00 -06:00
dbadfa1c4c FEATURE: Suppport quoting self and env when we need them as tuple fields. 2019-01-06 14:28:29 -06:00
2c3f9c7b8f Add base64 as an importer type aside from string. 2019-01-05 14:33:12 -06:00
7793404975 MAINT: use dyn syntax for trait objects now. 2019-01-05 13:27:51 -06:00
a830047784 FEATURE: Add include as a string functionality.
Includes happy path tests for including a string.

fixes #15
2019-01-04 10:03:50 -06:00
59343d71d5 FEATURE: add a conatins operator
Adds the `in` operator that checks for fields in tuples and
elements in a list.

Fixes: #12
2019-01-03 11:42:11 -06:00
9ec73868b5 FEATURE: evaluate dot selectors as a binary operator now.
Also fixed a precedence bug in our parser.
2019-01-02 16:57:55 -06:00
a028960a43 REFACTOR/FEATURE: Treat selectors as an operator. 2018-12-31 17:31:34 -06:00
fb292b4684 REFACTOR: Unify the Binary Operator AST data structures. 2018-12-31 17:24:07 -06:00
2b7c8e65f8 REFACTOR: Better scope handling. 2018-12-31 17:13:58 -06:00
2c9abddb61 REFACTOR: normalize eval method naming for values. 2018-12-31 11:08:39 -06:00
05aa57ae7f REFACTOR: Builder => FileBuilder 2018-12-31 11:08:32 -06:00
821f1e9fb2 MAINT: Cleanup
TODO and FIXME removals.
Replaced unnecessary alt_peek! macro.
Renamed some types for clarity.
2018-12-14 16:01:17 -06:00
2b47ca8617 FEATURE: Use UCG_IMPORT_PATH to identify the import paths.
fixes #9
2018-12-13 19:03:22 -06:00
f26e26d2ad FEATURE: Support search paths for import statements.
A step toward #9

Adds builder support. We do not yet wire in the import paths.
2018-12-13 18:29:41 -06:00
aab89f2d1a MAINT: Removed debug print statements. 2018-12-12 19:05:20 -06:00
8009c6a8a5 MAINT: Formatting cleanup. 2018-12-10 21:27:44 -06:00
9b5b7aa793 MAINT: Fix try macros to use ? 2018-12-06 13:14:01 -06:00
e9a0bde631 MAINT: Opt in to 2018 edition of Rust. 2018-12-06 12:23:52 -06:00
1d5f0319f3 FEATURE: Detect import cycles. 2018-11-28 21:12:09 -06:00
8d73b5f648 CLEANUP: Don't use file everywhere in error messages. 2018-11-28 20:48:04 -06:00
163420ff55 REFACTOR: More consistent naming for Builder methods. 2018-11-28 20:23:32 -06:00
960dbef591 REFACTOR: Pass file into the constructor for builders. 2018-11-28 20:11:34 -06:00
9d2d3843a5 MAINT: comment cleanup. 2018-11-27 15:03:27 -06:00
fe4bb1c9d7 FEATURE: allow tuples to have true or false as field names.
this allows selects where the condiotion is a boolean and you can choose
the true or false branch.
2018-11-26 23:08:14 -06:00
aa183960d3 FEATURE: support a strict mode for building.
When strict mode is off then give a warning for unset env variables
and return NULL.
2018-11-26 21:36:50 -06:00
1365a38700 FEATURE: Check bindings against the reserved word list for imports and let bindings. 2018-11-26 20:22:37 -06:00
5e07f24d91 FEATURE: handle ENPTY specially. in copy expressions. 2018-11-25 13:26:47 -06:00
b797f099b4 REFACTOR: root is actually always a file. Lets call it as such.
Also have a helper function to get the current build_dir.
2018-11-25 13:03:33 -06:00
fa96c7c0ef FEATURE: UCG Parameterized Modules
closes #10

Squashed commit of the following:

commit 3101c2bb9a385ed9e84481d36906a3e3ce93e571
Author: Jeremy Wall <jeremy@marzhillstudios.com>
Date:   Wed Nov 21 20:10:31 2018 -0600

    FEATURE: Module evaluation

    * handle evaluating the module definition.
    * Handle performing a module instantiation via the copy syntax.

commit 4ca863896b416e39f0c8eacc53384b9c514f6f14
Author: Jeremy Wall <jeremy@marzhillstudios.com>
Date:   Tue Nov 20 18:38:19 2018 -0600

    FEATURE: Add module parsing expression parsing to ucg.

    changes toward issue #10
2018-11-23 12:51:13 -06:00
bdf56f6d3c FEATURE: Allow self references when doing a tuple copy.
Closes #3
2018-11-16 10:36:06 -06:00
15026423db REFACTOR: Rename our error::Error type to BuildError. 2018-11-12 18:07:31 -06:00