Commit Graph

37 Commits

Author SHA1 Message Date
Nathan Braswell
80e31b8f6e Forgot my io mod 2020-04-02 14:23:49 -04:00
Nathan Braswell
eefa752d55 shortening of str and vec 2018-05-22 19:43:54 -04:00
Nathan Braswell
f71b5f3576 Init globals before lowering CTCE, allows CTCE to use imported functions, etc. 2016-07-06 00:16:39 -07:00
Nathan Braswell
0f2ac1421a Basic CTCE working! In between commit because #link(a) syntax changed to #link(a) 2016-07-03 22:50:42 -07:00
Nathan Braswell
6fee942756 Refactored interpreter into just functions, added a REPL to the main kraken. 2016-07-03 15:32:45 -07:00
Nathan Braswell
27fea0e90c work on multithread, interpreter, and prototyped a #line-in-simple-passthrough ast changing pass turned on with -g 2016-06-14 02:14:25 -07:00
Nathan Braswell
ce2eff42a6 Moved over compiler information printing and error to use stderr, enabled interpreter testing in tester. The interpreter passes 34/74 tests 2016-05-22 14:10:19 -07:00
Nathan Braswell
12dfa837e3 Added in extern global variables and printing of *char and string to stderr with printlnerr, printerr. Note that this will still compile in a previous version, but instead of extern, stderr will be newly declared. This is ok, because this version of the compiler never uses it, so we'll only use it after this one is bootstrapped in. 2016-05-22 13:08:10 -07:00
Nathan Braswell
828f36daab Adding in proper copy_construct into function calls and destruct afterwards. Doesn't correctly destruct return values yet. 2016-05-21 11:20:29 -07:00
Nathan Braswell
cf8090f825 Moved c stdlib variadic functions over to use ... 2016-05-19 23:34:29 -07:00
Nathan Braswell
cfcaff7887 Add support for variadic extern functions, as it turns out that you can't just specialize them with declarations. I.e., int a_func(int, ...) is different from int a_func(int, int) even if you only ever call a_func(1,2), etc. This commit is in preperation for moving to correcty variadic extern functions for the c stdlib (like printf, snprintf) 2016-05-19 23:17:32 -07:00
Nathan Braswell
ce1afa45f4 Added a lot to the interpreter, but some odd problem where snprintf seems to print the wrong thing something like a 10th of the time. Debugged it for a while over two days, and I've narrowed it down to the actual snprintf call. It seems to happen under some different circumstances for compiled versions too, so I'm just going to keep it like this for now. 2016-05-18 23:11:00 -07:00
Nathan Braswell
2dd381f7ea Implmented structs in the kraken interpreter! (nothing object-y implemented yet) 2016-05-15 18:36:13 -07:00
Nathan Braswell
967ae3d68e Added malloc/free with extern as well as all the other primitives and added pointer arithmatic and [] 2016-05-15 11:09:12 -07:00
Nathan Braswell
7aa1d9983b Some bugfixes/added errors, convert most to not use simple_passthrough 2016-04-30 15:38:28 -04:00
Nathan Braswell
cf46fb13af Add casting as a language feature. Have not removed the function yet as we need an inbetween version for the bootstrap 2016-04-18 22:56:29 -04:00
Nathan Braswell
464805b7aa Fix some bugs from last time, which I committed to make sure it didn't delete anything... 2016-02-05 05:11:02 -05:00
Nathan Braswell
4c569f4f8c Added function calls, printing out of pointers 2016-01-11 23:41:09 -05:00
Nathan Braswell
fcc0e770a5 Fixed a limitToFunction bug or two, work on ADTs 2015-11-06 03:23:55 -05:00
ChrisFadden
46dcd39399 Added colored print statements 2015-08-28 18:06:08 -04:00
Nathan Braswell
d72cbdcedb Serilization and caching the table works! 2015-08-26 03:45:34 -04:00
Nathan Braswell
3aad0263ce Added primitive serilization 2015-08-21 11:03:10 -04:00
Nathan Braswell
58ab3e311f Starting to really parse! Fixed the bad syntax trees (reduction copy_construct wasn't actually copying label because param and dest had same name) and fixed the krakenGrammer and CGenerator to allow escaped quotes in regular strings. add_children needs to be finished so the resulting trees don't go nuts with ambiguity, and some situations still cause vector access errors, which is odd. Also added the crazy simple write_file to io and the test_grammer.krak now outputs a syntax_tree.dot 2015-08-11 01:07:16 -04:00
Nathan Braswell
2c29846570 Swapped pointers to the other side for types to prevent ambiguity, i.e. *int instead of int* 2015-07-04 17:02:51 -04:00
Nathan Braswell
b62c3e729f Some more work, and a --parse-only option to support the new kraken.vim vim plugin that adds Syntastic support (and syntax highlighting) 2015-07-03 18:34:46 -04:00
Nathan Braswell
c50c977a9e Fixed the close over methods and member vars bug, but there's something remaining causing the safe_recursive_delete not to work. Gotta save progress and do other stuff 2015-06-27 18:06:02 -04:00
Nathan Braswell
47bc52f00c Some bugfixes, allow overloading of [] and add that to vector and string, work on regex. Need closures before that finishes.... 2015-06-08 21:47:02 -04:00
Nathan Braswell
6f9ceaa717 work on string, bug fixes, overloaded assignment operator. Still need to get overloaded copy_construct for declaration assignment 2015-06-01 01:43:23 -04:00
Nathan Braswell
87e1853713 Wooo! Fixed up remaining bugs in new syntax! 2015-05-09 06:24:56 -04:00
Nathan Braswell
e37836aea5 Working toward new C inline style 2015-04-04 01:32:40 -04:00
Chris Fadden
7363b53489 Made ChrisTest for testing numerical library 2015-03-16 13:49:05 -04:00
Nathan Braswell
6a311fb237 WOOO compiles all in one file! Dependencies resolved! Next up, C name mangeling for scoping 2015-03-11 01:58:10 -04:00
Nathan Braswell
5b57770774 Declarations are now written |type| identifier;, generally. Functions are similar |void| func() {}, etc. Special declarations still work, etc 2014-08-01 00:45:48 -07:00
Nathan Braswell
64fcb6b0b7 Traits for function templates working! Need to finish for objects and specilizations, and I think also else statements. 2014-07-18 08:52:15 -07:00
Nathan Braswell
03770028ad Fixed some bugs in Parser::firstSet and added a bit of caching. It still doesn't work quite right, though, there's some problem with nullable left recursion. However, it's better than it was, and I need to go to bed. More work later. 2014-06-30 01:57:50 -07:00
Nathan Braswell
63d9ec66e1 Added "Init Position Call" (takes the place of implicit constructors) and the this keyword! This was the structure needed for more sensable memory management. At least delete will need some updating before it becomes very usable, though. (Figuring out the types for function template instantiation) Anyway, good progress here! 2014-06-26 01:45:44 -07:00
Nathan Braswell
6a75832b59 Added trivial standard library and search paths. 2014-05-01 01:18:01 -04:00