Commit Graph

122 Commits

Author SHA1 Message Date
Danila Fedorin e7afa126c8 Stop using mangled names for local variables. 2020-09-10 15:14:19 -07:00
Danila Fedorin 688463570c Add assertion regarding local name mangling. 2020-09-10 15:05:02 -07:00
Danila Fedorin d3c719436a Move common code into loops. 2020-09-10 14:50:03 -07:00
Danila Fedorin a940503cea Add compile-time flag to disable output. 2020-09-10 14:07:28 -07:00
Danila Fedorin b23ffe1b21 Tweak parsed type error warning. 2020-09-10 14:04:06 -07:00
Danila Fedorin 828be79ab5 Make make_case_for throw from the second time on.
Also clean up the errors thrown a little bit.
2020-09-10 14:03:04 -07:00
Danila Fedorin 0e816e523a Add programs to trigger error cases. 2020-09-10 14:02:19 -07:00
Danila Fedorin 2ede230704 Add type errors to identifier nodes. 2020-09-10 12:59:26 -07:00
Danila Fedorin 87b51819e8 Prevent case compilation from crashing and burning. 2020-09-10 12:53:55 -07:00
Danila Fedorin b03e68bb28 Add more built-in boolean-specific instructions. 2020-09-10 12:44:41 -07:00
Danila Fedorin 9393e35a84 Register booleans as internal types. 2020-09-10 00:54:35 -07:00
Danila Fedorin b6df158280 Make sure to delete LLVM target machine. 2020-09-09 23:45:48 -07:00
Danila Fedorin adc95c8d04 Initialize graph indegree. 2020-09-09 23:44:53 -07:00
Danila Fedorin c7b2a4959f Add prototype impl of case specialization.
Boolean cases could be translated to ifs, and
integer cases to jumps. That's still in progress.
2020-09-09 22:49:35 -07:00
Danila Fedorin c1a8dc4557 Add 'internal' types. 2020-09-09 18:08:38 -07:00
Danila Fedorin 92a9ec2021 Replace throw 0 with real exceptions or assertions. 2020-09-09 17:19:23 -07:00
Danila Fedorin 1f7a53ccf6 Add sources for unification type errors. 2020-09-09 15:26:18 -07:00
Danila Fedorin 80f181cbb6 Add extra line after code fence. 2020-09-09 15:25:48 -07:00
Danila Fedorin 34357163cd Print locations in non-unification type errors. 2020-09-09 15:15:25 -07:00
Danila Fedorin 945d0f31c3 Add locations to patterns. 2020-09-09 15:15:09 -07:00
Danila Fedorin bdaa046a8c Require C++17 for optionals 2020-09-09 15:14:37 -07:00
Danila Fedorin 588ce99601 Add locations to error reporting. 2020-09-09 15:08:43 -07:00
Danila Fedorin 07ac3d72e4 Add a method to print location. 2020-09-09 14:41:16 -07:00
Danila Fedorin 2752703038 Touch up source index code. 2020-09-09 14:20:10 -07:00
Danila Fedorin c648e20a02 Keep track of locations in definitions. 2020-09-09 14:19:46 -07:00
Danila Fedorin 350a630213 Make driver keep track of line numbers and locations. 2020-09-09 13:57:01 -07:00
Danila Fedorin 5a9d4c1e92 Update ASTs to actually take in locations.
Didn't realize I broke the build by leaving this out.
2020-09-09 13:29:28 -07:00
Danila Fedorin a6839c548e Start using driver, and switch to file IO. 2020-09-09 13:28:43 -07:00
Danila Fedorin 2f09401685 Enable locations. 2020-09-09 12:21:50 -07:00
Danila Fedorin e7367ef86e Fork off version 13 of the compiler. 2020-09-08 18:38:05 -07:00
Danila Fedorin 2d8c4d16c0 Fix typechecking of mutually recursive functions. 2020-06-21 00:47:26 -07:00
Danila Fedorin 6198738acc Make proofreading-based fixes. 2020-06-20 23:50:26 -07:00
Danila Fedorin 59231fd00d Finish draft of part 12 of compiler series. 2020-06-20 22:03:57 -07:00
Danila Fedorin 645d41159b Remove unneeded parent class. 2020-06-18 23:06:13 -07:00
Danila Fedorin 4a94d0e507 Add first draft of lambdas. 2020-06-14 02:00:20 -07:00
Danila Fedorin 1e5d43e5e8 Properly handle null types in pattern typechecking. 2020-06-14 00:43:39 -07:00
Danila Fedorin 33f8040886 Use mangled names in variable environments. 2020-06-13 23:43:52 -07:00
Danila Fedorin 522d196446 Maybe finish the let/in code? 2020-06-01 00:23:41 -07:00
Danila Fedorin baf7427737 Start working on translation. 2020-05-31 18:52:52 -07:00
Danila Fedorin 6d1be9527e Start working on a lifted version of a definition. 2020-05-31 14:37:33 -07:00
Danila Fedorin a78db7500f Adjust type output. 2020-05-31 00:50:58 -07:00
Danila Fedorin de08f0febf Mark some definitions as global, so as not to capture them. 2020-05-31 00:34:12 -07:00
Danila Fedorin dec6d834f5 No longer destroy the list of free variables.
It so happens that this list will tell us which variables
need to be captured.
2020-05-30 23:29:36 -07:00
Danila Fedorin feeee2039b Check for free variables in the environment before generalizing. 2020-05-30 16:40:27 -07:00
Danila Fedorin 74f54abf5b Add parsing of let/in. 2020-05-28 14:44:12 -07:00
Danila Fedorin 63f82a1c64 Add typechecking to let/in expressions. 2020-05-26 00:52:54 -07:00
Danila Fedorin 35928b3a54 Extract ordering functionality into definition group. 2020-05-25 23:58:56 -07:00
Danila Fedorin 5b6378c9e4 Add a struct to contain groups of mutually recursive definitions. 2020-05-25 22:11:45 -07:00
Danila Fedorin 71bc55c696 Fork off the 12th version of the compiler. 2020-05-25 21:20:41 -07:00
Danila Fedorin fa19fa2792 Build and test version 11 of the compiler instead of 10. 2020-04-26 21:28:34 -07:00