aboutsummaryrefslogtreecommitdiffstats
path: root/src/constrain.cpp
AgeCommit message (Collapse)AuthorFilesLines
2010-12-29Destructuring (i.e. working `match').David Robillard1-1/+11
git-svn-id: http://svn.drobilla.net/resp/resp@374 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-29Literal lists (i.e. list quoting).David Robillard1-8/+21
Compile type expressions. Only compile a top-level function if program has code to run (i.e. isn't just definitions). Cast tuples to Object when necessary to avoid LLVM IR type mismatches (for cons stores and return values). Fix memory leaks. git-svn-id: http://svn.drobilla.net/resp/resp@369 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-28Use fst ("first") instead of head and rst ("rest") instead of tail.David Robillard1-5/+5
git-svn-id: http://svn.drobilla.net/resp/resp@366 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-28Add quote form, to allow expressions literal symbols and lists (lists not ↵David Robillard1-0/+13
yet implemented). Quoting is a thin lexical concept - a quote of a symbol/list compiles to a symbol/list, rather than interpreted as code (i.e. a variable/call, respectively). A quote of anything else is equivalent to its quotee, e.g. a quote of a String is simply that string (the quote is removed at an early stage by the compiler). There is no Quote data type, or explicit unquoting, or anything like that. git-svn-id: http://svn.drobilla.net/resp/resp@365 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-27Remove weird __tag_is form by adding a T_LITSYM type and using = operator.David Robillard1-0/+1
Step towards having first class symbols... git-svn-id: http://svn.drobilla.net/resp/resp@362 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-27Kill AType.David Robillard1-43/+40
git-svn-id: http://svn.drobilla.net/resp/resp@359 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-26More sensible check for Fn type.David Robillard1-3/+1
git-svn-id: http://svn.drobilla.net/resp/resp@355 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-26Update headers.David Robillard1-2/+2
git-svn-id: http://svn.drobilla.net/resp/resp@352 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-09Fix cpplint warnings.David Robillard1-0/+2
git-svn-id: http://svn.drobilla.net/resp/resp@329 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-09Add let form.David Robillard1-0/+33
git-svn-id: http://svn.drobilla.net/resp/resp@328 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-09Sort code.David Robillard1-114/+114
git-svn-id: http://svn.drobilla.net/resp/resp@326 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-09Make environment always referenced by symbols.David Robillard1-6/+6
Intern symbol strings, but not ASymbol objects themselves, so each symbol can have a different Cursor. Fixes missing locations in error reporting. git-svn-id: http://svn.drobilla.net/resp/resp@324 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-08Clean up function compilation stuff.David Robillard1-1/+1
Add some utilities to for using named types. git-svn-id: http://svn.drobilla.net/resp/resp@313 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-07Saner recursive descent lexer/parser.David Robillard1-12/+0
git-svn-id: http://svn.drobilla.net/resp/resp@306 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-04More const-correctness (remove all use of const_cast).David Robillard1-9/+9
git-svn-id: http://svn.drobilla.net/resp/resp@297 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-03Remove use of RTTI for AST.David Robillard1-22/+24
git-svn-id: http://svn.drobilla.net/resp/resp@290 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-03Merge AST::operator==David Robillard1-0/+1
git-svn-id: http://svn.drobilla.net/resp/resp@289 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-03Remove AST::constrain.David Robillard1-54/+61
git-svn-id: http://svn.drobilla.net/resp/resp@287 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-03Merge ACall and ATuple.David Robillard1-24/+12
git-svn-id: http://svn.drobilla.net/resp/resp@285 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-03Remove AFn.David Robillard1-9/+13
git-svn-id: http://svn.drobilla.net/resp/resp@284 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-02Remove ACall subclasses.David Robillard1-55/+57
git-svn-id: http://svn.drobilla.net/resp/resp@282 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-02Remove use of ACall subclasses for contrain phase.David Robillard1-108/+140
git-svn-id: http://svn.drobilla.net/resp/resp@279 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-02Work towards removing different classes for each type of expression.David Robillard1-4/+4
git-svn-id: http://svn.drobilla.net/resp/resp@278 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-02Represent code as list structure (i.e. traditional LISP lists built from ↵David Robillard1-51/+56
pairs), rather than tuple structure. Remove unused/crufty depoly stage. Remove cps from AST interface (but keep cps.cpp code around for later). Improved command line interface for compilation stages (options -T -L -S). git-svn-id: http://svn.drobilla.net/resp/resp@277 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-09-30Preliminary work on algebraic data types and run-time typing.David Robillard1-5/+74
git-svn-id: http://svn.drobilla.net/resp/resp@270 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-08-19Generalise `cons': a call to any symbol beginning with an uppercase characterDavid Robillard1-1/+2
(i.e. a type symbol), e.g. (Thing 2), is a call to a type constructor which creates a Tup containing the arguments, with the symbol as the first element in the type expression, e.g. (Thing 2) has type (Thing Int) and compiles to a tuple containing a single Int. The type constructor `Tup' can be used as a `cons' replacement to construct generic tuples. git-svn-id: http://svn.drobilla.net/resp/resp@264 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-08-19Add quote to syntax (currently only a lexeme is quotable, no lists...)David Robillard1-0/+7
git-svn-id: http://svn.drobilla.net/resp/resp@262 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-08-19Coherent AString and Lexeme implementation.David Robillard1-0/+6
A Lexeme is any "token" read from input, a lexeme has not yet beeen parsed and could parse to anything, e.g. a string, an expression, a number, etc. Lexemes are not (yet?) exposed to the language or ever compiled. A String is a string literal, which can contain any character directly except " and \. There are two special escapes: \" and \\, any other character following a \ is a syntax error. Fix garbage collection of REPL objects, leading to type errors from type variable re-use because a type variable for a given AST's /address/ exists, but that address has actually been deleted and reused by new (i.e. make top level REPL expressions and types be GC roots). git-svn-id: http://svn.drobilla.net/resp/resp@261 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-08-18Give `def' statements type `Nothing.David Robillard1-0/+1
Causes REPL to succeed silently instead of printing an error. git-svn-id: http://svn.drobilla.net/resp/resp@260 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-04-13Better error reporting when unification fails (report both locations, and ↵David Robillard1-2/+1
preserve locations during substitution). git-svn-id: http://svn.drobilla.net/resp/resp@256 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-04-13Restructure as a source translation based compiler.David Robillard1-17/+16
Implement support for closures (via lambda lifting phase). git-svn-id: http://svn.drobilla.net/resp/resp@254 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-04-08Exception specifiers.David Robillard1-11/+11
More efficient constraints construction (c') in unify(). git-svn-id: http://svn.drobilla.net/resp/resp@253 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-04-08Tuplr -> Resp (RESource Processing).David Robillard1-5/+5
git-svn-id: http://svn.drobilla.net/resp/resp@252 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2009-10-16Make ellipses a new kind (AType::DOTS).David Robillard1-1/+1
git-svn-id: http://svn.drobilla.net/resp/tuplr@238 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2009-10-16. operator for destructuring Tuples (cons).David Robillard1-0/+21
git-svn-id: http://svn.drobilla.net/resp/tuplr@236 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2009-10-16Cons.David Robillard1-0/+12
git-svn-id: http://svn.drobilla.net/resp/tuplr@235 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2009-10-15Type and const correct Subst::apply.David Robillard1-4/+3
git-svn-id: http://svn.drobilla.net/resp/tuplr@232 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2009-10-15Remove all use of ATuple::at().David Robillard1-30/+43
git-svn-id: http://svn.drobilla.net/resp/tuplr@229 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2009-10-15Replace use of ATuple::at(0) with ATuple::head().David Robillard1-6/+6
git-svn-id: http://svn.drobilla.net/resp/tuplr@227 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2009-10-15Clean up function type system.David Robillard1-50/+37
Unify function types globally, rather than construct a "generic type" locally, since this didn't take into consideration captured bindings, leaving the generic type not as solved as it could be. git-svn-id: http://svn.drobilla.net/resp/tuplr@226 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2009-10-15Always use error-checking (and terser) Constraints::constrain over push_back.David Robillard1-4/+4
git-svn-id: http://svn.drobilla.net/resp/tuplr@225 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2009-10-15Make TEnv purely a type environment.David Robillard1-6/+5
git-svn-id: http://svn.drobilla.net/resp/tuplr@222 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2009-10-14Fix compilation (oops).David Robillard1-1/+1
git-svn-id: http://svn.drobilla.net/resp/tuplr@221 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2009-10-14Clean up ACall::constrain and stick to type domain for error reporting.David Robillard1-20/+15
git-svn-id: http://svn.drobilla.net/resp/tuplr@220 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2009-10-14Merge two loops to build parameter types.David Robillard1-17/+12
git-svn-id: http://svn.drobilla.net/resp/tuplr@218 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2009-10-14Remove cruft.David Robillard1-11/+7
git-svn-id: http://svn.drobilla.net/resp/tuplr@216 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2009-10-13Move TEnv::buildSubst to unify.cpp.David Robillard1-33/+0
git-svn-id: http://svn.drobilla.net/resp/tuplr@212 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2009-10-13Remove unnecessary lexical addressing stuff.David Robillard1-4/+3
git-svn-id: http://svn.drobilla.net/resp/tuplr@211 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2009-10-07Remove double lookup.David Robillard1-3/+2
git-svn-id: http://svn.drobilla.net/resp/tuplr@203 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2009-10-06Move argument substitution building from LLVM backend code to generic type code.David Robillard1-0/+33
git-svn-id: http://svn.drobilla.net/resp/tuplr@193 ad02d1e2-f140-0410-9f75-f8b11f17cedd