Commit Graph

  • 8bafe58593 safety commit because i want to try cargo fix mark 2023-04-29 16:35:25 +0200
  • 690a4716fd add missing files Dummi26 2023-04-29 01:48:06 +0200
  • 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() }) Dummi26 2023-04-29 01:45:00 +0200
  • 0a2c67c2d5 changed syntax from var::type to var: type Dummi26 2023-04-26 22:53:22 +0200
  • d9c354685f changed syntax from var::type = statement to var: type = statement Dummi26 2023-04-26 22:52:31 +0200
  • dd017ffea4 added clone() to dereference by cloning Dummi26 2023-04-26 17:53:25 +0200
  • 9741fa64cc added thread(t) type to parser Dummi26 2023-04-26 15:09:59 +0200
  • e4ef85a9ea fixed bug with function-iterators Dummi26 2023-04-26 14:18:57 +0200
  • 34be9adef2 fixed interactive mode activating on cli arguments that shouldn't activate it. Dummi26 2023-04-26 13:52:30 +0200
  • 49f465c444 updated tutor and changed 'while' to 'loop' because while should be while <condition> <statement> while loop is loop <statement>, which is the actual syntax mers uses. Dummi26 2023-04-25 20:54:35 +0200
  • e8ee005743 removed print statement from tutor/mod.rs because it messed with cli editors Dummi26 2023-04-25 19:43:11 +0200
  • 89cc7971ee - revamped fmt methods for VData, VType, and some others => value == parse(value.fmtgi(..)) - updated debug() method to output static_type :: dynamic_type :: value - updated to_string() to output "val" if called on a string (it just uses the fmt methods) - updated format() to only take strings as arguments Dummi26 2023-04-25 19:38:00 +0200
  • 99f8c504a4 tutor Dummi26 2023-04-25 15:15:21 +0200
  • d66a0f37f2 tutor Dummi26 2023-04-25 15:15:03 +0200
  • ca1dbf2722 changed "var type = value" syntax to "var::type = value" and added the tutor (mers -t) Dummi26 2023-04-25 02:55:16 +0200
  • 7baa1c2aba removed some temporary eprints Dummi26 2023-04-24 16:27:42 +0200
  • 9c1564b426 added var_name var_type = statement syntax, which forces the statements return type to fit in var_type. This is useful if your initial value doesn't cover all types (like [ ...], which is a list with an inner type that cannot exist because there are 0 valid types, making the list completely useless. but arr [int/string ...] = [] expands that inner type to int/string, making the list usable) Dummi26 2023-04-24 15:55:37 +0200
  • 14d004d848 added dereferences to assignments: x = 1 y = &x *y = 2 x.debug() will print 2 because we changed x through the reference. Dummi26 2023-04-24 13:49:20 +0200
  • ed8aecde86 added support for shebangs: if the file starts with "#!", the first line will be ignored. Dummi26 2023-04-20 19:37:29 +0200
  • 5bb4d2e4a5 readme claimed &statement was valid, but it isn't. now it correctly states that &varname must be used to get a reference. Dummi26 2023-04-19 16:16:34 +0200
  • 2fc3d52626 update readme to include the correct fn type syntax and fixed an example where list types didn't use ... yet. Dummi26 2023-04-19 16:13:45 +0200
  • 2ac19dcd00 added iterators: any function that takes no arguments can be used in a for loop. Each iteration, it will be called once. If its value matches, the for loop will execute its block with that value. If the value doesn't match, the for loop will stop. This also required adding function types: fn((input11 input12 output1) (input21 input22 output2)). The type maps inputs to outputs, because the add function isn't add(int/float int/float) -> int/float, but rather add((int int int) (int float float) (float int float) (float float float)) (notice that add(int int) can't return float and any other add can't return ints). Dummi26 2023-04-19 15:40:05 +0200
  • 2293e9365c added boolean functions not(a), and(a v) and or(a b). and and or are short-circuiting. Dummi26 2023-04-19 14:32:30 +0200
  • ea5346f81c fixed a bug where the character directly following a float literal would be ignored (because parsing the float accidentally used that character). this is what caused [12.5] to break. Dummi26 2023-04-15 16:01:34 +0200
  • c484d2cbb2 fixed parser infinite looping because parse_function() on a function with no args (fn my_func() {}) would break before the ')'. Dummi26 2023-04-15 15:41:07 +0200
  • 65fdc87c01 added more accurate type-checking to some of the builtins Dummi26 2023-04-15 14:41:52 +0200
  • effdc096a2 implemented working float literals and removed the 5,2 workaround: 5.2 is now a float! (see 10.5.debug()). Dummi26 2023-04-15 14:22:41 +0200
  • b2a36416cf implemented better errors (not finished). this also prevents crashes (because there were todo!()s and panic!()s as temporary errors before) when an error is found while in interactive mode. Dummi26 2023-04-14 20:47:13 +0200
  • dfd83fa581 fixed warnings in mers, but one warning in parse.rs will stay Dummi26 2023-04-14 17:10:54 +0200
  • c526912ecb fixed typo Dummi26 2023-04-13 22:47:18 +0200
  • 699c0081aa removed mers_libs/*/Cargo.lock Dummi26 2023-04-13 17:55:18 +0200
  • 7a7da1e946 add \n to files that dont end in one to prevent weird errors Dummi26 2023-04-13 17:51:38 +0200
  • 52be3d04f0 fixed small issue in readme Dummi26 2023-04-13 17:45:52 +0200
  • a2a976c7f9 - changed the list type from [t] to [t ...] - added more examples to the readme Dummi26 2023-04-13 17:40:25 +0200
  • a6389b7ac0 added -e flag to readme Dummi26 2023-04-13 04:23:29 +0200
  • 233590ead3 added -e: mers -e println("you don't need a file for this") Dummi26 2023-04-13 04:21:15 +0200
  • 765a2597ee added thread example and made small changes to the readme Dummi26 2023-04-13 04:04:48 +0200
  • c2362aca13 fixed small issue in readme Dummi26 2023-04-13 03:27:51 +0200
  • ce61749260 - Added assume_no_enum() because the Err enum is used at least as often as [] for reporting fails. - changed substring(a b) behavior from "b is the max length of the resulting string" to "b is the exclusive end index, unless it is negative, in which case its abs() value is the maximum length". - fixed a bug in libs/path - added the http_requests library, which can be used to make very basic GET requests - fixed a bug in the gui library that would mess up button handling - you can now escape comments using a backslash \: \// will turn into the literal //, \/* will turn into the literal /*. Useful for URLs (because comments work in string literals). Putting a backslash before a linebreak will also ignore that linebreak (useful in long string literals) Dummi26 2023-04-13 03:04:47 +0200
  • 2acdcd3f53 moved Cargo.toml and src/ to /mers/Cargo.toml and /mers/src/ because rust-analyzer was apparently very confused when I was trying to edit projects in mers_libs/*/. Dummi26 2023-04-12 22:23:07 +0200
  • 5b051e72f1 improved the mers library system Dummi26 2023-04-04 23:48:01 +0200
  • 38d641ffcd updated readme Dummi26 2023-04-01 20:39:18 +0200
  • fd32fd2ba7 updated readme Dummi26 2023-04-01 20:30:34 +0200
  • 3dea550565 . Dummi26 2023-04-01 16:29:46 +0200
  • 794e776e25 changed enum type syntax because A: int/string is ambiguous while A(int)/string and A(int/string) aren't. Builtins now use the Err enum variant for errors. Dummi26 2023-04-01 16:27:52 +0200
  • b1a90d5872 implemented enum functionality. todo: default functions should use Ok/Err enum variants? Dummi26 2023-04-01 14:38:46 +0200
  • 260e42d4a7 changed while loop break to use matching (any matching value breaks) and added the same break functionality to for loops. Dummi26 2023-03-30 19:11:21 +0200
  • 52973eb0f8 changed remove and pop to return [] or [v] instead of [] or v to remove the ambiguity when successfully returning v with v = []. This also makes .assume1() work with these functions. Dummi26 2023-03-30 18:46:45 +0200
  • 2ba1ed270d changed get to return [] or [v] instead of [] or v because v might be []. This also matches the 0-or-1-length-tuple patterns for optionals (so it can be unwrap()d using .assume1()). Dummi26 2023-03-30 18:38:05 +0200
  • 45186e3803 parser bugfix, started working on external libraries (libraries can register functions and react to function calls via stdout/stdin) Dummi26 2023-03-24 14:57:42 +0100
  • 296163d5fe added examples Dummi26 2023-03-22 19:37:21 +0100
  • 2c12556af9 fixed compiler errors Dummi26 2023-03-22 19:23:18 +0100
  • 744f268bfd added some string methods and assume1, which takes ([]/[t]) or ([]/[t] string) and returns t. If the first argument passed is [] instead of [t], panics with the custom error message, if one was provided (string argument). Dummi26 2023-03-22 19:20:02 +0100
  • 2a00d01812 fixed a bug with while loops running unreachable!() code instead of looping on [] values. Dummi26 2023-03-17 17:05:19 +0100
  • 021a247369 update readme Dummi26 2023-03-17 16:56:55 +0100
  • fff0b868ce added files and fixed a bug in run() and thread() Dummi26 2023-03-17 16:54:27 +0100
  • 04b9cbc4c7 fixed readme issue Dummi26 2023-03-17 16:33:23 +0100
  • 6712097829 added match statements. Dummi26 2023-03-17 16:29:42 +0100
  • 664de5c347 cleaned up script/value.rs by splitting it up into val_data and val_type. Dummi26 2023-03-17 14:23:54 +0100
  • a43a23da8c - added type-checking for builtins. Except for the List-functions, all builtins should now be properly type-checked. - changed List.insert(..) from (list, index, element) to (list, element, index) to be more in line with List.push(list, element) Dummi26 2023-03-16 15:33:43 +0100
  • 585017da46 improved and fixed some bugs with the switch! unhandled type error and some builtins Dummi26 2023-03-14 20:58:35 +0100
  • 1b43dfebda fixed bug where the last item in a list would break the parser if it wasn't followed by a whitespace, ), or }. (added ] to the list of statement-breaking chars) Dummi26 2023-03-14 20:21:36 +0100
  • 862418ce98 almost functional type checking for builtins; builtins return types work as expected now (for List.get, Thread.await() etc) Dummi26 2023-03-14 20:14:30 +0100
  • 5ca0373640
    (2) Mark 2023-03-14 12:42:39 +0100
  • 5d868a759d
    basis for type-checked builtins (1) Mark 2023-03-14 12:40:15 +0100
  • 3ac886115a
    . Mark 2023-03-14 09:21:48 +0100
  • f43f5e518c
    script file has to be provided as the first arg Mark 2023-03-14 09:19:58 +0100
  • d0cf7ab588 added the concept of references: prefix any (single) type or variable with & to get a reference. This is used for List.{push, insert, pop, remove, get} to avoid copying the list unnecessarily. Dummi26 2023-03-13 23:05:27 +0100
  • a4fbb8dd97 - fixed a bug with t.fits_in(rhs) regarding inner types - added //...\n and /*...*/ comment syntax - added tuple.n indexing, where n is an int <= the tuples length (this is checked before the script runs) Dummi26 2023-03-12 15:42:19 +0100
  • 15b78dc0b6 removed leftover debug prints Dummi26 2023-03-12 13:27:50 +0100
  • fea095a8d6 fixed a bug with inner types, like [int/string], always being parsed as single types, even though this isn't necessary. Dummi26 2023-03-12 13:26:51 +0100
  • 05ecc809c3 - fixed a bug with switch syntax closing brace being recognized twice by the parser - writing to a variable when the type that is being written doesn't fit will shadow the variable to prevent weird issues where a variable would be changed to a different type from within a block, then after that block it would still have data of that type but its type wouldn't reflect this, causing switch! to miss some cases. might remove shadowing in the future, who knows. - added run_command_get_bytes Dummi26 2023-03-12 13:14:18 +0100
  • 369b37371c adjusted list syntax to be [<content> ...] to create a visual difference from tuples, which don't have the ... before the ]. Dummi26 2023-03-12 12:43:21 +0100
  • ff1f487a6f updated output format, added script/builtins.rs Dummi26 2023-03-12 12:35:45 +0100
  • 6da8a77304 fixed some bugs Dummi26 2023-03-10 13:44:18 +0100
  • efff8c1d70 . Dummi26 2023-03-09 18:51:58 +0100
  • f2d176e0dd added another example to the readme, showing switch statements Dummi26 2023-03-09 13:26:54 +0100
  • 63721b9e26 initial code commit, implemented switch statements and if-else syntax. Dummi26 2023-03-09 13:24:52 +0100
  • bb2f4b541c initial code commit. variables, functions, basic multithreading works. missing a lot of builtins and possibly operators (+-*/). good proof of concept for now. Dummi26 2023-03-08 22:19:51 +0100
  • e8a02a8b30
    Create README.md Mark 2023-03-07 16:10:48 +0100