Commit Graph

174 Commits

Author SHA1 Message Date
Mark
05c88b7826 fix variable shadowing not working (how was this not noticed until now??) 2024-02-22 19:13:50 +01:00
Mark
7bfdbca3a5 add pretty-print to mers cli 2024-02-22 16:30:39 +01:00
Mark
f3f2c13702 add loop syntax, remove loop function, change CLI 2024-02-22 13:34:02 +01:00
Mark
66c191ba2c mers version to 0.5.0 2024-02-17 14:58:29 +01:00
Mark
931f70fe4c add example 02 to mers_lib 2024-02-17 14:57:40 +01:00
Mark
2a981865a8 add mers/README.md 2024-02-17 14:47:42 +01:00
Mark
0c87c69743 add examples, prepare for new readme 2024-02-17 13:23:50 +01:00
Mark
5d752c9969 change parse_int/float and debug, add spawn_command and childproc_* functions 2024-02-17 11:46:07 +01:00
Mark
2a218ddbe2 delete test.mers file 2024-02-15 11:37:37 +01:00
Mark
9de61da1ef fix Cargo.toml for mers cli 2024-02-15 10:57:06 +01:00
Mark
5d3efe4788 version bump to 0.4.0 2024-02-15 10:56:34 +01:00
Mark
44da27b414 Add chain function and chained iterator, which behaves like Rust's flatten 2024-02-14 17:13:05 +01:00
Mark
6ed16b90ec bump cli version 2024-01-31 19:29:44 +01:00
Mark
392fdb2a36 pump version in dependencies of cli 2024-01-31 19:28:17 +01:00
Mark
0226dbd02b add missing file, bump version 2024-01-31 19:23:01 +01:00
Mark
58706c4539 update cli 2024-01-16 12:08:47 +01:00
Mark
16cdcddc72 . 2024-01-16 12:06:55 +01:00
Mark
9fe981fc6c fix bug where subtypes of list didn't include type of empty list 2024-01-16 12:00:16 +01:00
Mark
2d373d1ba7 make some types/fields public 2024-01-16 10:38:45 +01:00
Mark
8c235a98aa update readme 2024-01-11 13:18:54 +01:00
Mark
5be264e63c prepare to publish to crates.io 2024-01-11 13:05:52 +01:00
Mark
4cf349a680 add mers.wasm file which can be executed with wasmtime
so you can do:

wasmtime mers.wasm exec '"Hello, World!".println'
2023-12-12 22:32:06 +01:00
Mark
0a9eea2045 fix bug where error would reference wrong file 2023-11-24 13:19:38 +01:00
Mark
b6d708db3d improve/fix errors in #include 2023-11-17 10:09:44 +01:00
Mark
12925fed67 improved error messages
- some small bugs are now fixed
- include comments in error messages (if this causes issues, use --hide-comments)
- colors should make more sense now
- error-related things moved to mers_lib/src/errors/
2023-11-16 14:50:09 +01:00
Mark
39951a59e9 add #include 2023-11-15 17:55:07 +01:00
Mark
8bdd6e00e8 Add lock_update function for safer multithreading
&v = (v, 1).sum might fail if two threads do it at the same time or something, so you can now lock the reference to ensure no other thread messes with your data while you update its value
2023-11-10 13:18:34 +01:00
Mark
ea95a16c30 added better error messages inspired by rustc/cargo
but not as good
2023-10-23 21:48:15 +02:00
Mark
b39a768099 . 2023-10-19 18:46:15 +02:00
Mark
2a7cb08596 mers rewrite is starting to be usable 2023-08-14 17:17:08 +02:00
Mark
07745488b3 sorted mers_lib/src/program/configs/ and added cargo features 2023-07-28 15:20:02 +02:00
Mark
b81dac682e full rewrite, kinda works 2023-07-28 00:33:15 +02:00
Mark
16258c7a0a updated readme. again. 2023-07-18 18:45:42 +02:00
Mark
b6d01c7c25 changed regex builtin and added binaries to git repo 2023-06-29 15:16:31 -04:00
Mark
f0314817a2 . 2023-06-26 17:53:27 -04:00
mark
701ead37c1 remove error on "wrong" main function args (which are no longer "wrong" since the last commit) 2023-06-17 15:35:42 +02:00
mark
47dc763b23 . 2023-06-16 18:49:12 +02:00
mark
77178addac default fn args are now empty instead of args [string ...] 2023-06-16 18:44:48 +02:00
mark
3032d3c115 fixed examples, fixed bug due to VType changes 2023-06-12 19:06:20 +02:00
mark
d94f727eaa references can now be of type &(int/float): two types, one reference. 2023-06-12 18:18:45 +02:00
mark
46dbb13e0f fixed warnings, cargo clippy, and mers-nu 2023-06-06 15:22:45 +02:00
mark
f91d452bd1 removed allow(dead) and allow(unused) 2023-06-06 13:52:16 +02:00
mark
1c749da401 changed VType internals 2023-06-06 13:51:33 +02:00
mark
f7feb688e8 order of operations, tests, VSingleType::Function
- moved && and || in order of operations to make a == b && c == d work as expected
- added some .mers files to mers/tests
- changed VSingleType::Function (setup for future type system changes)
2023-06-06 03:09:39 +02:00
mark
8c6f8c17f1 update readme, docs, site, and version to 0.2.0. 2023-06-04 21:59:38 +02:00
mark
db0be51fa4 added arrow syntax for forcing output types and added the "any" type (which is basically useless and will likely change in the future) 2023-06-04 21:33:35 +02:00
mark
efe8a177dc changed the error 2023-06-04 20:17:36 +02:00
mark
c7642ef911 there can now be multiple functions with the same name. The most recently declared one will be preferred if multiple would be valid. 2023-06-04 20:07:50 +02:00
mark
c2594ab6dc . 2023-05-27 19:37:01 +02:00
mark
d62a3f5aa8 added dereference syntax to go from &t to t by prefixing any statement with a *. for *x.f(), the * is applied to x, not the whole chain (like & would) 2023-05-27 19:20:28 +02:00
mark
f43ab49408 removed some annoying debug prints 2023-05-27 18:38:33 +02:00
mark
e0f13bdb85 fixed issue https://github.com/Dummi26/mers/issues/1#issue-1728187127 and fixed = vs. := in README. 2023-05-27 18:31:58 +02:00
mark
68c2b52ad7 bugfix: changing the implementation of get() to respect references broke some builtin functions which did not account for this 2023-05-26 21:55:04 +02:00
mark
82f2f028fa fixed line counts ignoring newlines after a // comment 2023-05-26 21:47:47 +02:00
mark
4356858ab2 made syntax cheat sheet a bit clearer 2023-05-26 20:18:09 +02:00
mark
45f6f30de3 revamped switch and match syntax 2023-05-26 20:02:46 +02:00
mark
be9403d63d added destructuring assignments for tuples (and lists on the left) 2023-05-26 18:46:47 +02:00
mark
e766e78e96 updated site + added docs/builtins.md + statements can end with ',' to differentiate '1, -2' from '1 - 2' == '-1'. 2023-05-25 00:22:03 +02:00
mark
b4b33b1c82 added := for initialization/declaration 2023-05-24 22:32:54 +02:00
mark
8e16140b0f fixed oversight 2023-05-24 01:00:42 +02:00
mark
c32419508e fixed examples 2023-05-23 23:56:45 +02:00
mark
9d3a149648 to_runnable treats assignment to a variable as initialization/declaration unless is_ref is true. if the variable doesn't exist yet, it will be created. for custom parser implementations, this means that making all variable assignments ones where is_ref is true will work just fine, but explicit declarations can be done by setting it to false if desired. always leaving it at false will repeatedly shadow the variable, so this isn't recommended although it does work. 2023-05-23 23:30:12 +02:00
mark
1ec7296f50 . 2023-05-23 20:52:48 +02:00
mark
9fd09eff37 fixed order of operations 2023-05-23 20:49:39 +02:00
mark
22b4ace81b added \r and \0 escape sequences 2023-05-23 20:24:32 +02:00
mark
07a443a60b <, <=, > and >= are ordered to happen before == and != instead of defaulting to left-to-right 2023-05-23 19:12:26 +02:00
mark
14d1995d8b add order of operations to the parser ( . | + - | * / % | == != < <= > >= | = ) 2023-05-23 12:20:36 +02:00
mark
7af9902b6a fixed [[2]].0.0 parsing 0.0 as a float, removed get_ref() and made get() return a reference to the inner value if called on a reference to a collection (&[int ...].get(0) returns []/[&int]). 2023-05-23 12:01:27 +02:00
mark
56b457e1b3 add missing file 2023-05-19 21:28:57 +02:00
mark
b5924b5da1 -f+c will print the parsed script with colored highlighting 2023-05-19 21:25:05 +02:00
mark
f2f5af94a7 . 2023-05-18 02:31:04 +02:00
mark
ac8d3befb7 temporarily made cloning actually clone, giving up on CopyOnWrite for now because I kept finding tiny bugs. This might harm performance, but overall performance was bad and will still be bad so who even cares, at least everything kindof works now. 2023-05-18 00:08:28 +02:00
mark
aff55fdc9e changed VData system again, renamed src/script to src/lang and added src/c.mers, which is an example something that currently does not work properly due to the VData implementation (and serves as a reminder to fix the issue) 2023-05-14 00:11:36 +02:00
mark
f8102c8fe6 (maybe?) fixed inner mutability on immutable (shared) values 2023-05-12 15:32:56 +02:00
mark
c501a6e558 fixed bug with function args and custom types 2023-05-12 15:03:20 +02:00
mark
f76ff55401 removed type_syntax.mers test because type force syntax will change (and has been removed for now).
i plan to move it to the statement itself rather than the assignment
2023-05-12 01:02:42 +02:00
mark
bba48b311f changed assignment parser from var = statement to statement = statement
left side of assignments can now be various different things instead of just variables. any statement that returns a reference can be used to assign to the value behind that reference. variables are automatically referenced, so the '&' can be omitted. if the variable contains a reference and that reference should be used, dereference it with *varname instead of just varname.
2023-05-12 00:44:47 +02:00
mark
6f31abd5cc changed VData implementation. It will now always (exception: references) behave like a clone BUT it will avoid cloning whenever possible using Copy-on-Write-style logic. 2023-05-11 14:49:49 +02:00
mark
79b169d951 fixed bug where all but the first loop iterations would write data to the mutable variables from the last iteration(s) even though the variables are supposed to be completely local: is_init can be set on steatements that have an output_to to force them to always redeclare and never reassign the new value. 2023-05-11 01:56:33 +02:00
mark
9ec4acaf70 made custom type names case-insensitive 2023-05-11 01:11:12 +02:00
mark
4efee9e2a2 completely changed the VData/VDataEnum system: Multiple VData can share one VDataEnum via an Arc<Mutex<VDataEnum>>. If one wants to modify the data, it copies it (Copy on Write). This copying is skipped for shared mutable data (references). This was necessary for the get_ref() function. Expect bugs! 2023-05-11 01:04:15 +02:00
mark
ceddb886a9 changed usize/isize static size types from u32/i32 to u64/i64 2023-05-10 20:02:36 +02:00
mark
a7bb3e67fa libraries can now work threaded if they wish (see http_requests). This means that multiple functions provided by one library can run at the same time (using thread(), see http.mers) and actually do the work they need to do simultaneously. 2023-05-09 22:11:13 +02:00
mark
5a8edd9605 update site 2023-05-04 05:42:45 +02:00
mark
4c86897a71 fix nushell_plugins not compiling due to rename of parse module to parsing 2023-05-01 01:05:22 +02:00
mark
77cd1358e6 fixed bad error message if no arguments are provided 2023-04-30 22:41:36 +02:00
mark
b83f54cb2d added basic tests 2023-04-30 22:21:46 +02:00
mark
ca3dd4c798 forgot to add files to last commit. L. 2023-04-30 21:37:13 +02:00
Dummi26
0feb1b8778 added nushell support. 2023-04-30 17:31:50 +02:00
mark
1a446248e4 fixed 'type [custom type] does not fit in [litterally the same type but not custom]' problem 2023-04-29 19:56:54 +02:00
mark
ef5874747e added custom types that can be defined using 'type <name> <type>' 2023-04-29 19:04:38 +02:00
mark
8bafe58593 safety commit because i want to try cargo fix 2023-04-29 16:35:25 +02:00
Dummi26
690a4716fd add missing files 2023-04-29 01:48:06 +02:00
Dummi26
09d0d29138 added macro support, syntax is !(macro-type ...), i.e. !(mers my_file.mers) or !(mers { "value to compute at compile-time".regex("\\S+").assume_no_enum() }) 2023-04-29 01:45:00 +02:00
Dummi26
0a2c67c2d5 changed syntax from var::type to var: type 2023-04-26 22:53:22 +02:00
Dummi26
d9c354685f changed syntax from var::type = statement to var: type = statement 2023-04-26 22:52:31 +02:00
Dummi26
dd017ffea4 added clone() to dereference by cloning 2023-04-26 17:53:25 +02:00
Dummi26
9741fa64cc added thread(t) type to parser 2023-04-26 15:09:59 +02:00
Dummi26
e4ef85a9ea fixed bug with function-iterators 2023-04-26 14:18:57 +02:00
Dummi26
34be9adef2 fixed interactive mode activating on cli arguments that shouldn't activate it. 2023-04-26 13:52:30 +02:00