Commit Graph

81 Commits

Author SHA1 Message Date
Nathan Braswell
8d0996fb47 Added in bitwise operators 2016-04-19 18:39:01 -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
d5b930739f Some fun adding in var var and var ref 2016-04-13 22:46:05 -04:00
Nathan Braswell
11eba1ba07 Port many tests and fix small bugs revealed in Kalypso (passes 24/72) - tests have also revealed more extensive features not yet implemented, and I seem to have messed up a test or two so that the C++ version also fails a couple more (it's at 59/71 now). Will investigate 2016-02-07 16:22:55 -05:00
Nathan Braswell
ca85edaeee added while loops and fixed unary operators (including correct precrement and decrement) 2016-01-19 03:16:16 -05:00
Nathan Braswell
4c569f4f8c Added function calls, printing out of pointers 2016-01-11 23:41:09 -05:00
Nathan Braswell
7f20a42178 Added type to values 2016-01-09 22:37:43 -05:00
Nathan Braswell
21a7afe66d Updated grammer to allow any statement as the child of an if_comp. Much more work incoming, but it will take past midnight, and I want to get what was finished earlier in before then to keep up my streak. 2016-01-03 23:50:07 -05:00
Nathan Braswell
33f97c0c82 work on ast_transformation, fix adt depending on type CGenerator order bug (correctly add poset dependencies) 2015-12-04 03:41:46 -05:00
Nathan Braswell
e7a49bf2e5 Match statements work with ADTs! (still no object stuff or anything though) 2015-11-14 19:05:28 -05:00
Nathan Braswell
fcc0e770a5 Fixed a limitToFunction bug or two, work on ADTs 2015-11-06 03:23:55 -05:00
Nathan Braswell
a84e2ee6e1 faster deserilitation, super basic enums 2015-08-29 21:45:55 -04:00
Nathan Braswell
b198cfb5b2 fix hex number maybe 2015-08-26 03:52:57 -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
dec9b7d0bd some tests failing because things have been made reference in vector, but grammer actually generates the state set for the real grammer in 2 minutes or so after a day of profiling and bugfixing, so this is gonna be committed. 2015-08-05 03:43:34 -04:00
Nathan Braswell
602810002b reference type added and very basic pass by reference works in CGenerator. Much more work to go to make sure complicated cases work and return by reference 2015-07-14 19:32:54 -04:00
Nathan Braswell
8c490908d4 Saving work pre-references 2015-07-13 12:16:30 -04:00
Nathan Braswell
8e2e356e80 Fixed c_comment regex to handle odd corner cases like /*//hi*/, etc 2015-07-06 02:29:46 -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
93cb0732cc Added back in float and double suffexes! 2015-06-28 20:50:07 -04:00
Nathan Braswell
ce6c8241fb Bugfixes, range(start,end,step), and beginning work on lexer and symbol 2015-06-28 20:25:27 -04:00
Nathan Braswell
dacfee6d22 Added the []= overloadable operator and implemented it for vector, map, and string 2015-06-27 11:46:31 -04:00
Nathan Braswell
5d688a5822 fix c_comments 2015-06-19 19:36:34 -04:00
Nathan Braswell
616b955bf9 new shorthand syntax for simple_passthrough if assigning to same name simple_passthrough(i=i, j=j : j = j:) becomes simple_passthrough(i,j : j :) 2015-06-19 13:28:02 -04:00
Nathan Braswell
30802fbcf8 Auto inferenced void return! 2015-06-19 11:27:37 -04:00
Nathan Braswell
48f613a38b More work on regex, fixed whitespace around && and operator= for vector 2015-06-14 11:13:30 -04:00
Nathan Braswell
d90cb4b6db Tons of stuff. Regex still a work in progress, along with related template member function scoping bugs 2015-06-09 20:02: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
b71bb84070 Now allow one-line functions without codeblocks\! (espically nice for lambdas) fun a():void println(4), or fun():void println(7) 2015-05-27 12:27:50 -04:00
Nathan Braswell
88bab7f0d7 Woo! Very basic lambdas! 2015-05-25 22:03:24 -04:00
Nathan Braswell
eebffb404e Ok, full functions as values support with types and fixes of earlier bugs. Now typedef the function pointer types when generateing C. 2015-05-22 22:30:25 -04:00
Nathan Braswell
65fd2ed9b7 Changed from typedef to obj and def 2015-05-16 12:05:23 -04:00
Nathan Braswell
aafb52d108 A kinda ugly/hacky addition, but overloading () as operator() works now! 2015-05-16 00:09:50 -04:00
Nathan Braswell
795f8715ff Break, continue, and DEFER statements! Woooo 2015-05-15 15:19:55 -04:00
Nathan Braswell
44d310c092 Got simple type inference for declaration statements working with test 2015-05-10 02:18:59 -04:00
Nathan Braswell
87e1853713 Wooo! Fixed up remaining bugs in new syntax! 2015-05-09 06:24:56 -04:00
Nathan Braswell
c22cadeed7 The template part of the new syntax! Gotta go transform all of stdlib and the tests now and see if any other bugs pop up 2015-05-09 03:13:40 -04:00
Nathan Braswell
08431aa748 New syntax starting to work! Not templates yet, that's next 2015-04-14 16:08:36 -04:00
Nathan Braswell
e3aa531856 Wooo actual scoping and better C interop 2015-04-10 00:37:31 -04:00
Nathan Braswell
e37836aea5 Working toward new C inline style 2015-04-04 01:32:40 -04:00
Nathan Braswell
639f4ff0fb Comments don't screw with as much now\! (and work with semicolon infrencing\!) 2015-03-25 15:59:49 -04:00
Nathan Braswell
b01078e7a0 If my measurements are right, WAYYYY better now. Missed a huge memory leak, now like 0.34147GB, I think 2015-03-23 15:52:25 -04:00
Nathan Braswell
6fa06f2b7e Removed LALR parser and an associated member from Symbol, which is used so much that actually got us down to ~3.42GB! 2015-03-23 15:28:03 -04:00
Nathan Braswell
2c4dbc60d1 Fixes for state generation to reduce memory usage - adding in optional semicolons balooned our memory usage to somewhere under 8 gigs, with some simple refactoring we're back down to a bit over 4. Needs to be smaller, but it's an improvement 2015-03-23 14:35:28 -04:00
Nathan Braswell
f8e82b5302 Added initial support for omitting semicolons! (the parser can now interpret either semicolons or linebreaks as the end of statements, but it can still interpret line breaks as white space too, so multi line statements still work.) You will need semicolons to break up multiple statements on the same line, however 2015-03-22 22:43:33 -04:00
Nathan Braswell
417e5ed898 Scope work progressing. Gotta fix bugs. Good save spot. 2014-12-19 18:29:33 -05: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
4cf8dbbd5b vector and vector test are finally working! Also found some bugs that I don't have time to fix before bed. Added file future_features.txt to keep track of bugs and features. 2014-07-28 01:52:15 -07:00
Nathan Braswell
87ad0c187e Fixed quite a few bugs, including makeing find template functions check for trait subset, not trait equality, and add the number required to the satisfied count. Based on what is now breaking, it looks like it's time to give the builtin functions types. 2014-07-23 02:23:21 -07:00
Nathan Braswell
eae538907d Fixed some mem things, found an odd parsing bug where a // comment before a function definition at top level does not parse. Deferring for now. 2014-07-20 20:42:26 -07:00