2007-04-25 Chris Lumens * TODO: Lots more stuff to do. Always more things to be done. [4508005f0b40] [tip] * src/bootstrap/main.sml: More consistent error handling. Start using that semantic analysis code I've been working on so much. [180f35ada8b6] * src/bootstrap/lib/hashtablemisc-sig.sml, src/bootstrap/lib/hashtablemisc.sml, src/bootstrap/lib/lib.cm: Added a structure with miscellaneous functions for dealing with hash tables. Right now all we need to do is be able to print them out. [9d5cf10c5168] 2007-04-23 Chris Lumens * src/bootstrap/semant/semant.sml: Add first round checking for type declarations as well. This works the same way as for function declarations. [e60cf1b495c8] * src/bootstrap/semant/semant.sml: Added the first part of function declaration checking. We first have to go through and create skeleton entries in the environment for each function. This makes mutual recursion possible. [0c279eb8eca1] * src/bootstrap/env/tablestack-fn.sml, src/bootstrap/env/tablestack- sig.sml: Add another convenience function that we need for semantic analysis. [4a0610669788] * src/bootstrap/semant/semant.cm, src/bootstrap/semant/semant.sml, src/bootstrap/semant/tempenv.sml: Move temporary environment building code into a temporary file. [e0a97aed22eb] * src/bootstrap/semant/semant.sml: More work on exception handlers. Also, clean up exception expressions by using functions instead of case stuff. [46501b4452fc] 2007-04-21 Chris Lumens * README: Update README for version requirement. [f5bf14607ba0] * src/bootstrap/lib/mstring-sig.sml, src/bootstrap/lib/mstring.sml, src/bootstrap/parse/mitchell.lex: Word32 -> Word for latest smlnj release. [b764733222b6] 2007-04-19 Chris Lumens * src/bootstrap/semant/semant.sml: Add type checking for exception expressions, and rework some of the code for record assignment expressions. These two things are very similar so it only makes sense to consolidate a little bit. [a2198ec4c5e9] * src/bootstrap/env/symbol-sig.sml, src/bootstrap/env/symbol.sml: We need another exception type for identifiers. [93296f21ef33] * TODO: Update TODO list. [25243c9bb72e] * src/bootstrap/semant/semant-sig.sml: Update signature. [2e43111d5cb6] * src/bootstrap/semant/semant.sml: Implement identifier lookup function, and enter/leave the stacks appropriately. This stuff may still get moved out into a separate data structure. [c0c9504b8b0b] * src/bootstrap/parse/absyn.sml: Store ModuleDecl AST nodes in the module table instead of just symtabs directly. Yes, this is pretty gross. I should come up with a better way to do this. [554266a87f4a] 2007-04-18 Chris Lumens * src/bootstrap/semant/semant.sml: Pass the modulestack value to every type checking function. [c6702b15f9f0] * src/bootstrap/parse/absyn.sml, src/bootstrap/parse/mitchell.grm, src/bootstrap/semant/semant.sml: Add symtabs and moduletabs back into the AST. I previously thought this was a bad idea, but it beats having to create yet another tree structure to hold these things in. And we need a tree structure for looking up identifiers in modules later. [ff0fc0ff960f] * src/bootstrap/env/tablestack-fn.sml: sml needs to be told these two types are the same. [4a065d42688f] * src/bootstrap/semant/semant.sml: Update for new environment structures. This only fixes building. It doesn't really start to make use of the new code. [448bf270e29d] 2007-04-16 Chris Lumens * src/bootstrap/env/env.cm, src/bootstrap/env/moduletab.sml, src/bootstrap/env/moduletabstack.sml, src/bootstrap/env/symtab- sig.sml, src/bootstrap/env/symtab.sml, src/bootstrap/env /symtabstack-sig.sml, src/bootstrap/env/symtabstack.sml, src/bootstrap/env/tablestack-fn.sml, src/bootstrap/env/tablestack- sig.sml: Created a new system for managing tables and stacks of tables. We now maintain two separate sets of tables - one for symbols, and one for module contents. Therefore, we need more generic structures to make this code more simple. Here it is - using a built-in functor to create symbol tables, and specifying our own functor to define the stacks. This also gets rid of the need for a bunch of our own symbol table manipulation code. [f05ad1c9b074] * src/bootstrap/env/symbol-sig.sml, src/bootstrap/env/symbol.sml: Move symbol hashing functions into the Symbol structure. [e988bac6ef6e] * TODO: Did some more stuff. [578d1b097de5] 2007-04-12 Chris Lumens * src/bootstrap/semant/semant.sml: Add code to create the base Integer and Boolean environments, and put those in the global environment. This is probably all going to change very soon though. [c83a1d1d0388] * src/bootstrap/semant/semant-sig.sml: An AST is really just a list of declarations, so that's what semant should take in. [81b054920e4e] * src/bootstrap/env/symtab-sig.sml, src/bootstrap/env/symtabstack- sig.sml, src/bootstrap/env/symtabstack.sml: Add comments. Add a function to make a new empty stack. [7f71726641ef] 2007-03-21 Chris Lumens * docs/typing: Update name resolution rules since we're in the process of rewriting that code. Perhaps I can make this stuff simpler at the same time. [14a1d4c3bc1d] 2007-03-16 Chris Lumens * src/bootstrap/Makefile, src/bootstrap/absyn.sml, src/bootstrap/env/env.cm, src/bootstrap/env/types-sig.sml, src/bootstrap/env/types.sml, src/bootstrap/mitchell.grm, src/bootstrap/mitchell.lex, src/bootstrap/parse/absyn.sml, src/bootstrap/parse/mitchell.grm, src/bootstrap/parse/mitchell.lex, src/bootstrap/parse/parse.cm, src/bootstrap/semant.sml, src/bootstrap/semant/semant-sig.sml, src/bootstrap/semant/semant.cm, src/bootstrap/semant/semant.sml, src/bootstrap/sources.cm, src/bootstrap/types.sml: I think that's the last of the source tree reorganization for now. [134f946d24f3] * src/bootstrap/Makefile, src/bootstrap/entry.sml, src/bootstrap/env /entry-sig.sml, src/bootstrap/env/entry.sml, src/bootstrap/env /label-sig.sml, src/bootstrap/env/label.sml, src/bootstrap/env /symbol-sig.sml, src/bootstrap/env/symbol.sml, src/bootstrap/env /symtab-sig.sml, src/bootstrap/env/symtab.sml, src/bootstrap/env /symtabstack-sig.sml, src/bootstrap/env/symtabstack.sml, src/bootstrap/label.sml, src/bootstrap/sources.cm, src/bootstrap/symbol.sml, src/bootstrap/symtab.sml, src/bootstrap/symtabstack.sml: Move a bunch more code around and split signatures out into their own files. This is almost starting to resemble a real project. [36da625f627e] * docs/grammar, docs/typing: Change header comment. [769f786b467b] 2007-03-15 Chris Lumens * src/bootstrap/entry.sml, src/bootstrap/semant.sml, src/bootstrap/sources.cm, src/bootstrap/symtab.sml, src/bootstrap/symtabstack.sml: Move Entry out into its own file. [3f5409f0d8ac] * src/bootstrap/Makefile, src/bootstrap/lib/lib.cm, src/bootstrap/lib /listmisc-sig.sml, src/bootstrap/lib/listmisc.sml, src/bootstrap/lib /mstring-sig.sml, src/bootstrap/lib/mstring.sml, src/bootstrap/listmisc.sml, src/bootstrap/mstring.sml, src/bootstrap/sources.cm: Move some really basic library functionality into its own directory. Break files out into separate signature and structure files. [6511d990d7f2] * src/bootstrap/listmisc.sml, src/bootstrap/misc.sml, src/bootstrap/sources.cm: This file has been renamed too. [4fcd294aafde] * src/bootstrap/basety.sml, src/bootstrap/mstring.sml, src/bootstrap/sources.cm: In the interests of clarity and keeping things small, this file has been renamed. [c1aacb157af7] * src/bootstrap/absyn.sml, src/bootstrap/error.sml, src/bootstrap/main.sml, src/bootstrap/mitchell.lex, src/bootstrap/semant.sml, src/bootstrap/symbol.sml: Strip Error down to its bare minimum by moving exceptions into more logical places. I think there's still work to be done here on making exception handling smarter and cleaner, but that must wait for another time. [1ce9a1fb572d] * src/bootstrap/absyn.sml, src/bootstrap/mitchell.grm, src/bootstrap/semant.sml, src/bootstrap/symtab.sml: Abstract syntax trees and module tables should not hold module tables. Trying to simplify structures here to break the code up a little better. [5982eca472b2] 2007-03-14 Chris Lumens * src/bootstrap/sources.cm, src/bootstrap/symtab.sml, src/bootstrap/symtabstack.sml: Break SymtabStack out into its own file. [1e1d94d53373] * src/bootstrap/absyn.sml, src/bootstrap/mitchell.grm, src/bootstrap/semant.sml: It makes more sense for this to be defined as a type instead of as a datatype. [ba64f4d29f95] * src/bootstrap/semant.sml: Add a helper function for adding symbols to the symbol table stack, and start working on declarations. [e83d9ae340fd] * src/bootstrap/misc.sml: Add a function to split a list into two parts. This is useful at least in type checking recursive declarations, and possibly elsewhere. [8f97ef8c417c] 2007-03-12 Chris Lumens * src/bootstrap/symtab.sml: Add functions to print out the contents of a single symbol table as well as a whole stack. [9a40879cd48e] * src/bootstrap/symbol.sml: A more useful definition of Symbol.toString that includes the symbol's label. [ec8c9d5fb2ac] * src/bootstrap/label.sml: Add a dummy function to convert labels into strings. This is another case of adding code that looks stupid, but will be useful should the internal representation ever change. [c6f650e1c7e9] * src/bootstrap/symtab.sml: Add a symtab to SYM_MODULE entries. Also change insert to check for duplicate symbols and add insert' to do the old overwriting behavior. [1a3fb7d653c1] * src/bootstrap/symbol.sml: Add a Label.label to symbols. [6b36f22a4ab5] * src/bootstrap/absyn.sml, src/bootstrap/error.sml: Change SymbolError around to match the order of the other exception tuples. [13b0ead405ce] * src/bootstrap/label.sml, src/bootstrap/sources.cm: Add a module that provides support for generating labels. Labels are the identifiers that will eventually be emitted during assembly code generation. They are the regular mitchell identifiers converted out of Unicode and turned into unique strings. [c2d76d2e4f4c] * src/bootstrap/absyn.sml, src/bootstrap/mitchell.grm, src/bootstrap/semant.sml: Remove ty from various AST nodes, since we're never going to get around to adding them during semantic analysis and they were never used in the old C version anyway. [479e2638ba63] 2007-03-11 Chris Lumens * src/bootstrap/semant.sml: Move code around. [d1b5a6eb12dc] * src/bootstrap/semant.sml: Break the exception handling function out from checkExpr for readability. That was getting just a little bit too confusing. [905260a53781] * src/bootstrap/error.sml, src/bootstrap/semant.sml: TypeError now includes the position of the error. [f114cea95cd3] * src/bootstrap/symtab.sml: Rearrange things to fix unknown symbol errors. This should maybe get split out into separate files, turned into functors, or something. [efd63a26aae7] 2007-03-10 Chris Lumens * src/bootstrap/semant.sml, src/bootstrap/symtab.sml: Create a new SymtabStack structure that holds a stack of symbol tables so we can support multiple environments. Then modify the semant module to pass a stack around for later use. Also add in checking for exception handlers. [b7f3763a8c73] * ISSUES, README, SCHEDULE, TODO: Update documentation. [63849126763b] 2007-02-28 Chris Lumens * src/bootstrap/semant.sml, src/bootstrap/types.sml: Add a signature for the Types structure as well. [abed6aa56591] * src/bootstrap/semant.sml, src/bootstrap/symbol.sml: Opening a structure can produce some interesting results, so don't do it unless we really need to. Added a signature to the Semant structure as well. [ec9e6115f59a] * src/bootstrap/absyn.sml, src/bootstrap/semant.sml, src/bootstrap/symbol.sml, src/bootstrap/symtab.sml: Add a signature for the Symbol structure, hide the internal representation better, and then add a bunch of functions to manipulate symbols. Symtab doesn't need to know how to compare symbols since that's best handled interal to Symbol. [918ebfdf80b6] * src/bootstrap/misc.sml: Add a signature because we're trying to act more like a real, complicated project here. [eab85e6a0c2d] * src/bootstrap/semant.sml: The very beginnings of exception handler checking. [33b73670b496] * src/bootstrap/absyn.sml, src/bootstrap/mitchell.grm, src/bootstrap/mitchell.lex, src/bootstrap/symbol.sml, src/bootstrap/symtab.sml: MString is now in its own structure and provides some useful functions. Adapt to this new setup. [2bce1ad4cb11] * src/bootstrap/basety.sml: Make a real MString structure to handle this data type, rather than the crappy all-purpose structure that was there before. The structure's really starting to look like maybe it should implement the STRING signature instead of its own thing. [c2e80e30ebd0] * src/bootstrap/semant.sml: Moved helper functions elsewhere since they're needed in more than one place now. Reduce checkTy down to a single call to absynToTy. [fee3a75d4351] * src/bootstrap/absyn.sml: Added a mostly written function that converts AST subtrees into Types.Type. Still have to write stuff for handling Ids, but that's getting into the symtab stuff a bit too heavily for now. [f2142e9d7102] * src/bootstrap/symbol.sml: Move another support function from semant.sml to where it makes more sense. [2e8fd521cfd4] * src/bootstrap/misc.sml, src/bootstrap/sources.cm: Create a new support structure with one very basic function right now. This was in semant.sml, but it's way more useful as a utility function. [09ca2588c880] 2007-02-27 chris * src/bootstrap/semant.sml, src/bootstrap/sources.cm: Add the very beginnings of a type checker. Right now it consists of a bunch of stub functions so all AST nodes are represented and a couple full expr handling functions. Still nothing dealing with symbol tables, and I may have to change return values all around. However, something's better than nothing and at least now I'm thinking about it. [75259c3f5d9d] * src/bootstrap/types.sml: Add a stub type equality function for now. Of course, this is going to get a whole lot more complicated in the near future. [dcfb63957211] * src/bootstrap/absyn.sml, src/bootstrap/mitchell.grm: Change retval to absynTy for consistency with other decl types. [4c4245675998] * src/bootstrap/error.sml: Add a couple more exception types now that we're getting farther into it. These may need position information later. [e52db4f9bc34] 2007-02-24 chris * TODO, docs/mitchell.1, run-tests.sh: Miscellaneous minor changes. [1553f47b9802] * src/bootstrap/absyn.sml, src/bootstrap/basety.sml, src/bootstrap/error.sml, src/bootstrap/main.sml, src/bootstrap/mitchell.grm, src/bootstrap/mitchell.lex, src/bootstrap/options.sml, src/bootstrap/symbol.sml, src/bootstrap/symtab.sml, src/bootstrap/test/parser.sml, src/bootstrap/test/tokenize.sml, src/bootstrap/types.sml: Add a copyright notice to the top of everything. [b98ae2588241] * src/bootstrap/main.sml: Reorganize the Main structure a little bit, deal with a lack of input file in the command line options, and print the abstract syntax tree if the option is present. [fe6a6f940bbc] * src/bootstrap/getopt/getopt.sml: Trim down arguments to just the words - no leading dashes, and no trailing equal sign or options. This will make it easier to search the mapping. [5b4b84d75dcb] * src/bootstrap/options.sml: Handle --help and --version right away, instead of going all the way back up to the main program and back down for no good reason. [6b883cb02c83] * src/bootstrap/sources.cm: Need to include the getopt stuff here to make it build right. [1a584799410a] * src/bootstrap/parse.sml: mitchell.grm now does everything the hand-written parser did, so get rid of it. [1bf8a926e97b] * src/bootstrap/mitchell.grm: A mitchell program is actually a list of module declarations, so make sure we return that. [340bd4ede942] * src/bootstrap/options.sml: Handle the new getOpt return value. Also made some minor style changes. [50257c8dd773] * src/bootstrap/getopt/getopt-sig.sml, src/bootstrap/getopt/getopt.cm, src/bootstrap/getopt/getopt.sml: Add a copy of smlnj-lib's GetOpt structure, and then modify it to make the return value of getOpt more useful. This also required adding a small support structure to the getopt.cm file. [5a10904e9609] * src/bootstrap/getopt/stringmap.sml: Add a support structure for the new way of doing getopt. [bfd8c6a1b760] * src/bootstrap/getopt/betterinfo-sig.sml, src/bootstrap/getopt/betterinfo.sml: GET_OPT -> GET_OPT' and GetOpt -> GetOpt' since we're now including a whole copy of the getopt stuff. [ce4b171b62c6] 2007-02-21 chris * run-tests.sh: I don't expect sml to dump core on any test cases. [d98d5cd7b749] * Makefile, mitchell.in, src/bootstrap/Makefile: Generate a heap file and a script that can be used to run the heap file as a standalone executable. Now I've got something to automate the test cases again. [cec5758d30d3] * src/bootstrap/options.sml: CommandLine.name returns sml, which isn't what I want at all. [0dff03562c74] * src/bootstrap/main.sml: The main function needs to return an integer for ml-build to be happy. [8244ce702cd9] * src/bootstrap/error.sml, src/bootstrap/options.sml: exit and success are in OS.Process, not in OS. [fc6199814735] * src/bootstrap/main.sml, src/bootstrap/options.sml, src/bootstrap/sources.cm: Add a structure for processing command line options. Also add a structure to drive the whole compilation process, making use of all that example code I wrote in tests/parser.sml. We can almost generate a standalone executable now. [526e354dd4c1] * src/bootstrap/error.sml: Add a function to quit. During development, it just raises an exception. When this is in a release state, uncommenting the other definition will kill the compiler and drop you back to a shell. [61b15ab9f0ae] * src/bootstrap/Makefile: Sometimes, I'd like to be able to get rid of all the .cm stuff too. [b703c0e0a1c6] * src/bootstrap/getopt/ChangeLog, src/bootstrap/getopt/INSTALL, src/bootstrap/getopt/NEWS, src/bootstrap/getopt/README, src/bootstrap/getopt/betterinfo-sig.sml, src/bootstrap/getopt/betterinfo.sml, src/bootstrap/getopt/getopt.cm: Added David Shea's () better getopt library. [759d8e726d5a] 2007-02-19 chris * docs/grammar: Update for grammar changes in mitchell.grm. [b77d7cca1fea] * src/bootstrap/test/parser.sml: Unrecoverable errors apparently have repair messages as well. [9b76c01c26d3] * tests/case-001.mitchell, tests/case-003.mitchell, tests/case-006.mitchell, tests/case-007.mitchell, tests/exn-003.mitchell, tests/exn-006.mitchell, tests/exn-007.mitchell, tests/exn-010.mitchell, tests/exn-011.mitchell, tests/function-004.mitchell, tests/function-005.mitchell, tests/function-007.mitchell, tests/if-002.mitchell, tests/if-006.mitchell, tests/module-001.mitchell, tests/module-003.mitchell, tests/module-005.mitchell, tests/module-008.mitchell, tests/rec-007.mitchell, tests/scope-014.mitchell, tests/type-002.mitchell, tests/type-005.mitchell, tests/type-006.mitchell, tests/type-009.mitchell: Update test cases to include new HowFail lines. Tweak some test cases for the minor grammar changes that I had to make. [fb08f78ea3ba] 2007-02-18 chris * src/bootstrap/mitchell.grm: Type parameter lists in function calls are optional. [70842712d3a5] * src/bootstrap/test/parser.sml: Better error formatting. [9c61f7885fa8] * src/bootstrap/mitchell.grm: Add the symbols/words to the tokens for better error reporting. [593aeffde672] * src/bootstrap/test/parser.sml: Updated parser test code to use the new ml-antlr generated parser. There's still some work to be done on error formatting/reporting. [1ebc625acd98] * src/bootstrap/mitchell.grm: Finish up productions. Now for lots of testing. [17f49e0d1d85] * src/bootstrap/mitchell.grm: We only really need to pass an inherited attribute in one place, and that's when dealing with symbol references. [289e08e6ccec] * src/bootstrap/mitchell.grm: Get exceptions done. [db207fa3fc5d] 2007-02-17 chris * docs/grammar: Case expressions must now contain at least one branch in addition to any default. [746fb22bba42] * src/bootstrap/mitchell.grm: More productions. Case expressions now require at least one branch in addition to any default. [c20dec8ddb94] * src/bootstrap/mitchell.grm: Added more productions. [99358e1bcf2c] * src/bootstrap/absyn.sml: Use ml-lpt's position type instead of our own. [10bc96a18c61] * src/bootstrap/mitchell.grm: Add more to the expression productions. Start on the type productions and fill in several helper productions. [66d0fd699d9b] * src/bootstrap/mitchell.grm: Change indentation to help readability. Start working on filling in expression rules. [fe92a427d2e1] * .hgignore: Ignore intermediate files. [d51abfb4e215] * src/bootstrap/symtab.sml: Rename equality function, fix it to work with the new UTF8 representation, and make it publically available. Also make Entry the same in the signature and structure. [e009aa4b3b03] * src/bootstrap/symbol.sml: Add some comments. [bc4d8080ccdd] * src/bootstrap/basety.sml: Fix mstringToString for new UTF8 representation. [e5584e8753ea] * src/bootstrap/sources.cm: Time to drag the rest of the compiler internals in so we can start working on parsing. [6134ae99bbe5] * src/bootstrap/mitchell.grm: Stub out parser. [ae5cd5ff53f9] * src/bootstrap/tokens.sml: The ml-ulex lexer is working well enough that I don't need this hand-written lexer anymore. Probably still some bugs to work out, but nothing major. [e8e487dc51de] * src/bootstrap/mitchell.lex: TokenizeError doesn't take the filename anymore so don't add it into the exception. Enable string processing again. Convert escaped Unicode characters to their real representation. Fix line continuations. [3cf8be7e667f] * src/bootstrap/test/tokenize.sml: Reformat output for strings and handling exceptions. TokenizeError doesn't give the filename anymore so print that ourselves. [e031b515c965] * src/bootstrap/error.sml: We can't get the filename into the lexer, so just take it out of the exception definition. Hopefully, handlers will know the file we are processing. [4635fa34b1bb] 2007-02-16 chris * src/bootstrap/test/tokenize.sml: Convert the tokenize test to use the new ml-ulex system. [b1dcdd862408] * src/bootstrap/mitchell.lex: Reorganize things into more understandable blocks. Comment out string tokenizing for now since it's untested and results in a huge lexer. Define identifiers in terms of what they can't be, instead of what's allowed (since that's basically impossible). [86bff9c21838] 2007-02-13 chris * src/bootstrap/test/tokenize.sml: Print a more helpful token description for identifiers. [f5951a831c31] * src/bootstrap/mitchell.lex: Skip whitespace in the initial state correctly. [4d3b7f6f013f] * src/bootstrap/test/tokenize.sml: Convert tokenize tester to the new system. [c8572d3b0bfc] * src/bootstrap/mitchell.lex: Get rid of unneeded calls to eof on exceptions. [d6196ad7b27e] * src/bootstrap/Unicode/COPYRIGHT, src/bootstrap/Unicode/Chars/charClasses.sml, src/bootstrap/Unicode/Chars/charVecDict.sml, src/bootstrap/Unicode/Chars/dataDict.sml, src/bootstrap/Unicode/Chars/uniChar.sml, src/bootstrap/Unicode/Chars/uniClasses.sml, src/bootstrap/Unicode/Chars/uniRanges.sml, src/bootstrap/Unicode/Decode/decode.sml, src/bootstrap/Unicode/Decode/decodeError.sml, src/bootstrap/Unicode/Decode/decodeFile.sml, src/bootstrap/Unicode/Decode/decodeMisc.sml, src/bootstrap/Unicode/Decode/decodeUcs2.sml, src/bootstrap/Unicode/Decode/decodeUcs4.sml, src/bootstrap/Unicode/Decode/decodeUtf16.sml, src/bootstrap/Unicode/Decode/decodeUtf8.sml, src/bootstrap/Unicode/Decode/decodeUtil.sml, src/bootstrap/Unicode/SymDict/dict.sml, src/bootstrap/Unicode/SymDict/intDict.sml, src/bootstrap/Unicode/SymDict/intListDict.sml, src/bootstrap/Unicode/SymDict/intSetDict.sml, src/bootstrap/Unicode/SymDict/key.sml, src/bootstrap/Unicode/SymDict/stringDict.sml, src/bootstrap/Unicode/SymDict/symbolTable.sml, src/bootstrap/Unicode/Uri/uri.sml, src/bootstrap/Unicode/Uri/uriDecode.sml, src/bootstrap/Unicode/Uri/uriDict.sml, src/bootstrap/Unicode/Uri/uriEncode.sml, src/bootstrap/Unicode/Util/encoding.sml, src/bootstrap/Unicode/Util/intSets.sml, src/bootstrap/Unicode/Util/utilCompare.sml, src/bootstrap/Unicode/Util/utilError.sml, src/bootstrap/Unicode/Util/utilHash.sml, src/bootstrap/Unicode/Util/utilInt.sml, src/bootstrap/Unicode/Util/utilList.sml, src/bootstrap/Unicode/Util/utilString.sml, src/bootstrap/Unicode/config.sml, src/bootstrap/Unicode/unicode.cm: SML/NJ has its own unicode processing now, so we don't need this library any more. [a2b6960cba5a] * src/bootstrap/sources.cm: Comment out all portions of the compiler after parsing for now, since we're just trying to get that redone. Also tell CM to use ml- ulex and ml-antlr to handle their source files automatically. [a562ab004994] * src/bootstrap/mitchell.lex: Update for the latest changes in ml-ulex. Nothing notable here - just a lot of little fixes. [1ae4e4548f8d] * src/bootstrap/error.sml: Use the stream position instead of a tuple of integers for now. This may need to get changed back in the future. [8c86787b6735] * src/bootstrap/basety.sml: SML/NJ supports a Unicode type now, so let's use it. [bc051ec82880] 2007-01-23 chris * src/bootstrap/symtab.sml: Forgot to add the symbol table file when I committed the change that removed stuff from symbol.sml. [4addf1e0939e] 2007-01-21 chris * src/bootstrap/Makefile, src/bootstrap/mitchell.grm, src/bootstrap/mitchell.lex: Add the beginnings of parser generator and lexer generator input files, now that sml/nj includes really useful ones that understand Unicode. This is so far untested. [f985a4724c24] * src/bootstrap/sources.cm, src/bootstrap/symbol.sml: Move symbol stuff from symtab.sml to symbol.sml. [5501fbc793c7] 2006-09-12 chris * src/bootstrap/types.sml: Add a straightforward method to convert types into strings, since I'm not yet ready to really think about type checking. [2ca9eb700466] * src/bootstrap/symbol.sml: Use a better hashing function that takes subtable types into account. Remove the NONE type on Subtable since we have Option for that. [47997e90958a] 2006-09-09 chris * src/bootstrap/absyn.sml, src/bootstrap/basety.sml, src/bootstrap/parse.sml, src/bootstrap/sources.cm, src/bootstrap/symbol.sml, src/bootstrap/tokens.sml: Hide the internal representation of mitchell strings/identifiers with the new BaseTy structure. This has been bugging me for a while, actually. [af8e470acddf] * src/bootstrap/absyn.sml, src/bootstrap/parse.sml, src/bootstrap/sources.cm, src/bootstrap/symbol.sml: Add the very beginnings of symbol table support: get the basic types defined, add the functions used to create hash tables, hash, and compare. Moved the parser and AST over to using the new symbol table stuff instead of the stubs that were previously defined. Simplify the Symbol structure. [8bb94407ff2e] 2006-09-08 chris * src/bootstrap/absyn.sml, src/bootstrap/parse.sml, src/bootstrap/symbol.sml: Clean up symbol vs. symbol reference mess. Modify Symbol.symbol representation even though it's going to have to get changed again here pretty soon for symbol tables. Fix up AST printing a little bit to make it more clean and in line with how things are really represented. This commit sucks. [d642b86ac589] * docs/grammar, src/bootstrap/absyn.sml, src/bootstrap/parse.sml, src/bootstrap/symbol.sml: Add grammar and parser support for parametric types. [c9604799b2ec] 2006-09-07 chris * README, docs/typing: Update documentation a little bit for this parametric type stuff. [76dda20bde12] * src/bootstrap/absyn.sml, src/bootstrap/parse.sml, src/bootstrap/types.sml: Get rid of Types.NONE_YET as this is the reason we have the Option type. [e2d8c98edd71] * src/bootstrap/absyn.sml, src/bootstrap/parse.sml: Union type branches need a symbol table to insert value bindings into. [6844276ebb0d] * tests/case-001.mitchell, tests/case-002.mitchell, tests/case-003.mitchell, tests/case-004.mitchell, tests/case-005.mitchell, tests/case-006.mitchell, tests/case-007.mitchell, tests/case-008.mitchell, tests/case-009.mitchell, tests/case-010.mitchell, tests/case-011.mitchell, tests/echo-001.mitchell, tests/echo-002.mitchell, tests/exn-003.mitchell, tests/exn-006.mitchell, tests/exn-007.mitchell, tests/exn-012.mitchell, tests/fact-001.mitchell, tests/fib-001.mitchell, tests/fib-002.mitchell, tests/gcd-001.mitchell, tests/hello-001.mitchell, tests/hello-002.mitchell, tests/if-001.mitchell, tests/if-002.mitchell, tests/if-003.mitchell, tests/if-004.mitchell, tests/if-005.mitchell, tests/if-006.mitchell, tests/if-007.mitchell, tests/list-001.mitchell, tests/module-002.mitchell, tests/module-003.mitchell, tests/module-005.mitchell, tests/module-006.mitchell, tests/module-007.mitchell, tests/rec-001.mitchell, tests/rec-004.mitchell, tests/rec-006.mitchell, tests/scope-001.mitchell, tests/scope-003.mitchell, tests/scope-004.mitchell, tests/scope-005.mitchell, tests/scope-006.mitchell, tests/scope-007.mitchell, tests/scope-011.mitchell, tests/scope-012.mitchell, tests/scope-014.mitchell, tests/type-018.mitchell: Update to yet another new function syntax. Hopefully this is the last one of these I'll be doing as it's really tedious. [f9c6ee25a5ba] 2006-09-06 chris * ChangeLog, ISSUES, TODO: Update support files a little bit. The ChangeLog doesn't make sense because of the rewrite. [3a612db45252] * docs/grammar, src/bootstrap/parse.sml, src/bootstrap/tokens.sml, tests/function-001.mitchell, tests/function-002.mitchell, tests/function-003.mitchell, tests/function-004.mitchell, tests/function-005.mitchell, tests/function-006.mitchell, tests/function-007.mitchell, tests/function-008.mitchell, tests/function-009.mitchell, tests/function-010.mitchell, tests/function-011.mitchell, tests/function-012.mitchell, tests/function-013.mitchell, tests/function-014.mitchell, tests/function-015.mitchell, tests/function-016.mitchell, tests/function-017.mitchell, tests/function-018.mitchell, tests/function-019.mitchell: Simplify function call/declaration grammar. Instead of two lists surrounded by parens, use just one list for both type arguments and parameters but separate the two lists with a semicolon. This gets rid of a lot of the clutter. I hate all those random parens. [6c57df3c9005] 2006-09-05 chris * tests/case-011.mitchell, tests/exn-012.mitchell, tests/exn-013.mitchell, tests/function-017.mitchell, tests/function-018.mitchell, tests/function-019.mitchell, tests/list-002.mitchell, tests/module-008.mitchell, tests/rec-007.mitchell, tests/scope-013.mitchell, tests/scope-014.mitchell, tests/type-018.mitchell: Added a bunch more cheesy test cases to make sure list processing in the new parser works right and to test the syntax of some new features. [71a37fcb9c61] * src/bootstrap/parse.sml: Empty input files are an error. [ca23d5b6b8ff] * docs/grammar: Fix typo. [c3b426c5b83d] * src/bootstrap/error.sml: Don't need that anymore since the text is in parse.sml. [3b78688b94be] * src/bootstrap/types.sml: Fix typo. [d44ad921f7df] 2006-09-03 chris * src/bootstrap/absyn.sml: Some lists can be empty, so don't print out empty blocks for them. This makes the output a little more readable. [c7cdad04d614] * src/bootstrap/parse.sml: Make sure to build up the list if it's a more complicated identifier. [a5ace963935a] * src/bootstrap/absyn.sml: Clean up output a little. Nothing major here. [dcb6580edef6] * src/bootstrap/symbol.sml: Add a real toString method. This is good enough for printing out abstract syntax, but I might need to come up with something more clever later. [b9b9e1d3bf7a] 2006-09-02 chris * src/bootstrap/absyn.sml: Use the standard library function instead. [6349e222280d] 2006-08-31 chris * src/bootstrap/absyn.sml: Add a function to wrap all these optional values to make the code a little more compact. I think there's a function in Option to do just this, but I don't have access to the reference from an airplane. [c5c93adcab47] * src/bootstrap/absyn.sml: Clean up indentation inconsistencies and missing closing braces. [c7fca0f75bfb] * src/bootstrap/absyn.sml: Added the last AST printer. Now to just add some comments and make sure that every node is printed out with consistent indentation. [2e4c82f1ee2b] * src/bootstrap/absyn.sml: It only makes sense to have a function to print out a symbol, since that gets done so often. [2896671215b0] * src/bootstrap/absyn.sml: Remove wrapper functions for printing out AST lists, since I already wrote a couple functions that do just that. Almost have decls done. [e616422efd79] * src/bootstrap/parse.sml: Rename to decls for consistency. [45d535453008] * src/bootstrap/absyn.sml: Finish up expression AST printing. [5229ee2c6cca] 2006-08-30 chris * src/bootstrap/absyn.sml: More printers. [bb3b9962d08e] * src/bootstrap/absyn.sml: Here's a bunch of AST printing code for the easy parts of the AST. [3b6c7bca5c3b] * src/bootstrap/symbol.sml: Placeholder. [78397289684d] 2006-08-27 chris * src/bootstrap/test/parser.sml: Add a parser testing file. [6fac4be477ab] * src/bootstrap/parse.sml: Raise a more helpful error message for modules in decl expressions. [8648e461a5cd] * src/bootstrap/parse.sml: Module must contain at least one declaration, as well. [6ae14e97df59] * src/bootstrap/tokens.sml: Use TokenizeError instead of ParseError. Fix checking that all characters in a unicode string escape sequence are hex. [bedcdaf79e73] * src/bootstrap/error.sml: I like having a different exception for this, even if the messages are the same. [4dd9840e594c] * src/bootstrap/parse.sml: Bring default case branch parsing in line with the changes made for exceptions. [c0c4ef4038e6] * src/bootstrap/parse.sml: Use state' instead of state when processing exception declarations. Consume the Else token when reading a default list. [16ceeea3b253] 2006-08-26 chris * src/bootstrap/parse.sml: case expressions and exception handlers must have at least one branch to take (even if it is just the default). [c56262a4dae8] * src/bootstrap/parse.sml: Fix one use of state instead of state' in function call parsing, and checking for an identifier twice in module declaration parsing. [cd5959d0f352] * tests/case-001.mitchell, tests/case-002.mitchell, tests/case-003.mitchell, tests/case-004.mitchell, tests/case-005.mitchell, tests/case-006.mitchell, tests/case-007.mitchell, tests/case-008.mitchell, tests/case-009.mitchell, tests/case-010.mitchell, tests/echo-001.mitchell, tests/echo-002.mitchell, tests/exn-003.mitchell, tests/exn-006.mitchell, tests/exn-007.mitchell, tests/fact-001.mitchell, tests/fib-001.mitchell, tests/fib-002.mitchell, tests/function-001.mitchell, tests/function-002.mitchell, tests/function-003.mitchell, tests/function-004.mitchell, tests/function-005.mitchell, tests/function-006.mitchell, tests/function-007.mitchell, tests/function-008.mitchell, tests/function-009.mitchell, tests/function-010.mitchell, tests/function-011.mitchell, tests/function-012.mitchell, tests/function-013.mitchell, tests/function-014.mitchell, tests/function-015.mitchell, tests/function-016.mitchell, tests/gcd-001.mitchell, tests/hello-001.mitchell, tests/hello-002.mitchell, tests/if-001.mitchell, tests/if-002.mitchell, tests/if-003.mitchell, tests/if-004.mitchell, tests/if-005.mitchell, tests/if-006.mitchell, tests/if-007.mitchell, tests/list-001.mitchell, tests/module-002.mitchell, tests/module-003.mitchell, tests/module-005.mitchell, tests/module-006.mitchell, tests/module-007.mitchell, tests/rec-001.mitchell, tests/rec-004.mitchell, tests/rec-006.mitchell, tests/scope-001.mitchell, tests/scope-003.mitchell, tests/scope-004.mitchell, tests/scope-005.mitchell, tests/scope-006.mitchell, tests/scope-007.mitchell, tests/scope-011.mitchell, tests/scope-012.mitchell: Update test cases to new function argument syntax. [7286b4612869] * src/bootstrap/parse.sml: Finish symbol references, the most aggravating part of this whole grammar. [c4a953160248] * src/bootstrap/absyn.sml: Since ExnExps are basically the same as RecordAssnExps, convert ExnExp list into a list of tuples as well. Function calls should have a list of types instead of a list of names. Records cannot be referred to except from a BaseExpr since we're not that flexible. [531c681da668] * docs/grammar: Remove unneeded production. [ce4512caa58f] 2006-08-25 chris * src/bootstrap/parse.sml: Get rid of lots of unnecessary intermediate values. Shorten up and clean up code where appropriate. [89b13ccd722c] * src/bootstrap/parse.sml, src/bootstrap/tokens.sml: Condense (tok, file) into its own type, and then convert everything into using that new type. This has the big advantages of increasing readability, making the code smaller, and letting me get rid of lots of intermediate values. Those cleanups are coming next. [edd284649ea1] 2006-08-25 chris * src/bootstrap/parse.sml: I like wrappedLst much better taking a tuple of Tokens instead of a tuple of lists. [f9935afeecf6] * src/bootstrap/parse.sml: Allow certain lists to be null thanks to the magic of currying. [86940c69ce39] * src/bootstrap/absyn.sml: Function call AST nodes need to know the type parameters they're passing as well. [d05bbedfec91] * docs/grammar: Consistency between function declarations and function calls sure would be helpful. [6f380d5c72cc] 2006-08-24 chris * src/bootstrap/parse.sml, src/bootstrap/tokens.sml: It should be Tokens, not tokens. [f2a3dd2b98d9] * src/bootstrap/parse.sml: Add another generic function to process lists that can have a default element. I don't think there are any more generic functions waiting to get written now. Some more creative thinking will have to happen before this can be made much more simple. [7f0ad3068617] * src/bootstrap/parse.sml: Add a generic list parsing function, and use that throughout instead of duplicating all that very similar stuff. I think there's one more generic function I can write to help with this stuff. [d69951aaa1b1] * src/bootstrap/parse.sml: Get rid of lots of redundant list processing code by creating a helper function that deals with the surrounding tokens for us. [38e8565099f0] 2006-08-23 chris * src/bootstrap/parse.sml: Differentiate between the identifier-symbol and id production cases, changing callers where appropriate. Finish off the lists now that we have the identifier story straightened out. A few comments wouldn't hurt readability, though this code needs a whole lot more. [410d7a56895f] * src/bootstrap/absyn.sml: Exception handlers don't always have to have a symbol name, like in the default exception handler case. [a8b5bcd1fd6d] * src/bootstrap/absyn.sml, src/bootstrap/parse.sml: Fix compile errors in case expression parsing. Finish up expressions, though the exn list code isn't done yet. Getting pretty close. [07c071806890] * src/bootstrap/absyn.sml, src/bootstrap/parse.sml: Rework absyn a litle bit so it's easier to return absyn chunks from functions. Fill out types and expressions more in the parser. [1f36dfa0b8b8] 2006-08-07 chris * src/bootstrap/absyn.sml, src/bootstrap/parse.sml: Clean up some code. Condense let...in...end if only one value line exists. [be26352a81d4] 2006-08-05 chris * src/bootstrap/parse.sml: Add type declaration AST nodes. [245cee47c58b] * src/bootstrap/absyn.sml: It's easier to build the AST if these are tuples. Also, add the position. [95a5b9dc9e6b] * docs/grammar: Sync with source code comments. [677494f8ac2e] * src/bootstrap/parse.sml: Fill in helper functions parseNameLst and parseTypedNameLst. Make value and function parsing a little clearer with extra functions. [0fdb17db4fc4] 2006-08-04 chris * src/bootstrap/parse.sml: Finish declaration AST nodes, except for the obvious cleanups that need to be done to make this a little more readable. [de003da3e80a] * src/bootstrap/types.sml: Add yet another meaningless type, this one for when we're building the AST but have not yet given types to the nodes. [40c8725fa8cc] * src/bootstrap/absyn.sml: Functions need to know their list of type parameters. [b2d3b3820ff4] * src/bootstrap/parse.sml: Have "eat" spit out tokens as it consumes them to help with debugging. Minor code cleanups here and there. Use a much simpler parseId for now - we'll have to come back and look at this in the near future. Fix parseAbsorbDecl, which was not passing the right file object to parseId. [c435088ba80c] 2006-07-18 chris * src/bootstrap/test/tokenize.sml: Tokens has the ability to turn tokens into strings now. [9eb1f27c0d88] * src/bootstrap/tokens.sml: Print out a string form of identifiers and strings, even if we don't know how to print the unicode characters. [c899065bebcd] * editing/mitchell-syntax: Add syntax highlighting for "absorb" keyword. [d355d342fd50] * src/bootstrap/test/tokenize.sml: Add position printing to test that code out too. [d9a6080eda3e] * src/bootstrap/parse.sml: checkTok now takes a list of tokens to check, to make repetitive calls easier to deal with. Stub out declaration parsing functions since that seems to be the most natural place to go after modules can be parsed. Mark everything not done as TODO. [203595930e4b] 2006-07-18 chris * src/bootstrap/symbol.sml: Move the name mangling function out so it can be used in more places. [ecd5fb484ee6] * src/bootstrap/test/tokenize.sml: Updated to reflect changes in Tokens.tokens type. [068b376970f2] 2006-07-13 chris * src/bootstrap/parse.sml: Added lots more parsing functions. Danger: this doesn't compile right now, and there's lots of shims and stubs for the things that do pretend to work. I have no idea if this does anything right or not since it's totally untested. [1f0c30d32e5d] * src/bootstrap/absyn.sml: Remove position information from StringExp, since that's covered by Expr. [bd2aaa432b99] * src/bootstrap/symbol.sml: Added functions needed for creating abstract syntax. [90a1bd4fd8ff] * src/bootstrap/absyn.sml: Fix typo. [a812c25070d1] 2006-07-13 chris * src/bootstrap/sources.cm: Added parse.sml. [5f2b01446737] * src/bootstrap/parse.sml: Beginnings of the parser - added extremely basic functions for all productions and started fleshing some of them out enough to see what helper functions need to be written. Some of these miscellaneous functions could probably move into tokens.sml. [cacd499aaac2] * src/bootstrap/tokens.sml: Convert type of token from a more complex datatype to a tuple of position and the datatype. We need to do this because it's really hard to write generic functions that can extract the position information from a datatype. SML seems less flexible in this area than I would have expected. Oh well. [41dd0c56c5be] * src/bootstrap/error.sml: Add InternalError exception, though it needs more parameters. [3679e2115917] 2006-07-11 chris * README: The README is a little out of date with respect to the rewrite status. [57cab9c58323] * TODO, docs/grammar, docs/lang-ref, src/bootstrap/absyn.sml, src/bootstrap/tokens.sml: Added the absorb keyword, which makes a module's bindings available in the current level of scope. This should save a lot of typing later. [3a70a4b20212] * docs/lang-ref: Update to new EBNF style grammar. Explain the more complicated case-expr a bit. That documentation still probably needs some work. [b813933ddfe2] * docs/typing: Added typing rules for tag discriminated unions. [cfff5901dcb0] * TODO: Another update. [f60e810d11b0] * TODO: Updated. [be1fd92dc490] 2006-07-10 chris * docs/grammar: Convert to ENBF format, which is a whle lot easier to read and understand. Nice to get rid of all those stupid list productions. [cd54be2275c4] * docs/grammar: Support for explicit polymorphic types in the grammar. Function definitions must now supply a list of type parameters, just like formal parameters. Function calls must now supply a list of types to bind to these type parameters. Both lists are allowed to be empty, just like with formal parameters, but must still be specified. This is to keep the grammar unambiguous. [133e0a49155c] 2006-07-09 chris * docs/lang-ref: Explain exceptions in the language reference. [dd7d65076709] * TODO, docs/grammar, docs/lang-ref, src/bootstrap/absyn.sml, src/bootstrap/test/tokenize.sml, src/bootstrap/tokens.sml, src/bootstrap/types.sml: Initial grammar and type support for tag discriminated unions. Documentation is still very much lacking for this new type, so that should probably be the next thing I work on. [fce1ea756d52] * src/bootstrap/absyn.sml, src/bootstrap/sources.cm, src/bootstrap/symbol.sml, src/bootstrap/tokens.sml, src/bootstrap/types.sml: Added the initial abstract syntax tree and some support structures needed to represent AST nodes. Also added some brief comments. These changes do not yet include the union type stuff, since I haven't gotten that completely figured out yet. They do, however, take into account the recent grammar change where function declarations do not require a type. [d9c66b97f962] * src/bootstrap/tokens.sml: Fix typo. [9315cc2d98db] 2006-06-29 chris * docs/grammar: Function declarations no longer need a type given, since we can infer that from the type of the body. This will work just like value declarations, in that if a type is provided then the type of the body must match. [907140eb691a] 2006-06-28 chris * src/bootstrap/tokens.sml: Be more careful about making sure we have the right starting position for long tokens. Various minor cleanups. Looks like it's about time to start on the next chunk of this project. [67cd7541e351] * src/bootstrap/tokens.sml: Use functions for keeping track of those position numbers. Add a couple random comments. Check that all four characters in an escaped unicode list are valid hex, since SML doesn't care. [145b736e0589] * src/bootstrap/test/tokenize.sml, src/bootstrap/tokens.sml: Use lists instead of vectors. Use the old cs4240 trick of building up the lists in reverse with prepending, then reversing them at the end. This is totally faster. [5ac53d9d8037] * src/bootstrap/tokens.sml: Start accumulating words and numbers with the first character that makes them up. [fe747ca1cd46] * src/bootstrap/test/tokenize.sml: Print out COMMA and string contents, even though they won't make a lot of sense the way the unicode module formats them. Don't exit after a single file. [41a8aacaa66e] * src/bootstrap/test/tokenize.sml: Keep the consistent style with parens. [09361b5136fc] 2006-06-27 chris * src/bootstrap/tokens.sml: Limit comments to 80 columns. Move non-public functions under readChar. [0c9acbb00cf3] * src/bootstrap/tokens.sml: Skip whitespace when looking for regular tokens too. [28b0b3cdd3c8] * src/bootstrap/test/tokenize.sml: Added a program to exercise the tokenizer so it's easier to debug. Check the comment at the top for how to run. [5024eb50f5fa] * src/bootstrap/tokens.sml: There's no reason to have a Comment token, unless we for some reason want to be able to attach comments to the AST in the future. [7c5233446fa8] * .hgignore: Ignore all this temporary crud. [ea00e0150b6d] 2006-06-26 chris * src/bootstrap/error.sml, src/bootstrap/sources.cm, src/bootstrap/tokens.sml: Added the beginnings of a real compiler - some basic error handling stuff (only what we need right now, nothing else) and the tokenizing code. No testing has been done on this yet, and there's probably a ton of cleanups that could go into it. So start digging. [027a4786409a] * src/bootstrap/Unicode/COPYRIGHT, src/bootstrap/Unicode/Chars/charClasses.sml, src/bootstrap/Unicode/Chars/charVecDict.sml, src/bootstrap/Unicode/Chars/dataDict.sml, src/bootstrap/Unicode/Chars/uniChar.sml, src/bootstrap/Unicode/Chars/uniClasses.sml, src/bootstrap/Unicode/Chars/uniRanges.sml, src/bootstrap/Unicode/Decode/decode.sml, src/bootstrap/Unicode/Decode/decodeError.sml, src/bootstrap/Unicode/Decode/decodeFile.sml, src/bootstrap/Unicode/Decode/decodeMisc.sml, src/bootstrap/Unicode/Decode/decodeUcs2.sml, src/bootstrap/Unicode/Decode/decodeUcs4.sml, src/bootstrap/Unicode/Decode/decodeUtf16.sml, src/bootstrap/Unicode/Decode/decodeUtf8.sml, src/bootstrap/Unicode/Decode/decodeUtil.sml, src/bootstrap/Unicode/SymDict/dict.sml, src/bootstrap/Unicode/SymDict/intDict.sml, src/bootstrap/Unicode/SymDict/intListDict.sml, src/bootstrap/Unicode/SymDict/intSetDict.sml, src/bootstrap/Unicode/SymDict/key.sml, src/bootstrap/Unicode/SymDict/stringDict.sml, src/bootstrap/Unicode/SymDict/symbolTable.sml, src/bootstrap/Unicode/Uri/uri.sml, src/bootstrap/Unicode/Uri/uriDecode.sml, src/bootstrap/Unicode/Uri/uriDict.sml, src/bootstrap/Unicode/Uri/uriEncode.sml, src/bootstrap/Unicode/Util/encoding.sml, src/bootstrap/Unicode/Util/intSets.sml, src/bootstrap/Unicode/Util/utilCompare.sml, src/bootstrap/Unicode/Util/utilError.sml, src/bootstrap/Unicode/Util/utilHash.sml, src/bootstrap/Unicode/Util/utilInt.sml, src/bootstrap/Unicode/Util/utilList.sml, src/bootstrap/Unicode/Util/utilString.sml, src/bootstrap/Unicode/config.sml, src/bootstrap/Unicode/unicode.cm: Added a Unicode reading library for SML. The source of this code is fxp (http://www2.in.tum.de/~berlea/Fxp/). [392f947954f4] * Includes.mk, Makefile, po/Makefile, po/mitchell.pot, src/include/absyn.h, src/include/absyn_walk.h, src/include/basic_types.h, src/include/config.h, src/include/desugar.h, src/include/error.h, src/include/list.h, src/include/memory.h, src/include/parse.h, src/include/semant.h, src/include/str.h, src/include/symtab.h, src/include/tokens.h, src/include/translate.h, src/include/version.h, src/kern/.cvsignore, src/kern/Makefile, src/kern/absyn_printer.c, src/kern/absyn_walk.c, src/kern/desugar.c, src/kern/desugar_case.c, src/kern/desugar_decls.c, src/kern/error.c, src/kern/free_vals.c, src/kern/lift.c, src/kern/list.c, src/kern/main.c, src/kern/parse.c, src/kern/semant.c, src/kern/str.c, src/kern/symtab.c, src/kern/symtab_printer.c, src/kern/tokenize.c: Removed C code in preparation for rewrite in SML. [91dac1cef8ce] 2006-06-23 chris * .hgtags: Added tag PRE_REWRITE for changeset 1d7d9f50ff594c8a8e28183396ce84c41651e96b [9084742cad4e] 2006-01-12 chris * ChangeLog: Fix ChangeLog. I don't update this thing nearly enough to remember how it works. [1d7d9f50ff59] [PRE_REWRITE] 2006-06-23 chris * .hgtags: Added tag PREVIEW_5 for changeset 8f1641a285ac033fa9bef51e10670c3e99eb1a5a [70b60f2bacdf] 2006-01-12 chris * po/mitchell.pot: Update translation for new release. [8f1641a285ac] [PREVIEW_5] * docs/mitchell.1, src/include/version.h, src/kern/main.c: Bump version. [0d737091b023] * src/kern/lift.c: Remove debugging code. [cc40636ce12a] * src/kern/absyn_printer.c: Fix missing closing brace on id_expr_t. [5142a061d4f0] * src/include/desugar.h, src/kern/desugar.c, src/kern/lift.c: Commit beginnings of lambda lifting. Finally. [7dd2bdc5082a] * src/kern/Makefile: Fix page width. Add lift.c. [8e47dea64ad1] 2005-08-24 chris * src/kern/absyn_printer.c: How did tabs sneak in? [e1e824723121] * src/kern/error.c: Flush stdout before writing on stderr so output doesn't look so crappy. [b47c6150b107] 2005-08-23 chris * src/include/desugar.h, src/kern/Makefile, src/kern/desugar.c, src/kern/free_vals.c: Renamed lift.c to free_vals.c since that's really what it does. Lifting will be done by yet another AST pass. It's easier this way. [def6f9f17d4d] * src/include/absyn.h, src/include/symtab.h, src/kern/desugar_case.c, src/kern/desugar_decls.c, src/kern/free_vals.c, src/kern/parse.c, src/kern/semant.c: Add DU information for functions to the AST. All function nodes store a list of their callers which we can then use to update free value lists. Also do free value analysis iteratively taking into account values that may now be free in the current function because they are required parameters to nested functions. While this has not been extensively tested, it's starting to shape up pretty well. [4c892bdb3608] 2005-08-19 chris * src/include/list.h, src/kern/list.c: Added a function to concatenate two lists. Reorganize. [c69140246afd] * Includes.mk, src/kern/Makefile: Don't include optimization flags when debugging since gdb can't handle some of the things gcc can do (inlining certain static functions, for instance). [91f489af0a30] * TODO, docs/typing: Update type checking rules for exception handling. I think this is correct. [6e9d25259b76] 2005-08-10 chris * src/include/desugar.h, src/include/error.h, src/include/memory.h, src/include/symtab.h, src/include/tokens.h, src/kern/absyn_printer.c, src/kern/error.c, src/kern/parse.c, src/kern/semant.c, src/kern/symtab.c, src/kern/tokenize.c: See you in hell, 80 columns. These sure are some big important changes I'm committing right here. Useful progress for sure. [07c64ce5b712] 2005-08-04 chris * po/mitchell.pot: Updated translations file. [7db9221a8d3d] * docs/mitchell.1, src/include/config.h, src/kern/free_vals.c, src/kern/main.c: Add another option for controlling printing out the free value analysis. [57f25bc49bfa] * src/kern/free_vals.c: Maintain lists of free values found in each function and print the list out when we're doing with an AST function node. Note that this is just the first pass and does not take into account how this needs to be an iterative process. [9369749e4ebd] * src/include/absyn_walk.h, src/kern/absyn_walk.c, src/kern/desugar_case.c, src/kern/desugar_decls.c: Modify all tree walking functions to take an additional parameter for some arbitrary user data. This data is currently only needed in the free value analysis phase so we can maintain lists of free values as we walk the AST. This user data also needs to be a double pointer so we can modify the data later if we have to. Say goodbye to 80 columns in these files. 120 columns is the way of the future. [c5766df2e147] * src/kern/main.c: Correct error messages. [0ffcaba5073a] * src/kern/Makefile: Add some goofy compile flags to turn off type-punned warnings. I should probably figure out how to fix the problem instead, but this is a lot easier. [406dcd6e9856] 2005-07-23 chris * src/kern/desugar.c, src/kern/desugar_case.c, src/kern/desugar_decls.c: Fix missing parent backlinks. [e728fd99e291] * src/kern/absyn_printer.c: Some of these problems require a lot more debugging output. [f39d12b87607] 2005-07-14 chris * po/mitchell.pot: Regenerate for error message changes. [162c45f962f3] * src/include/error.h, src/include/memory.h, src/kern/absyn_printer.c, src/kern/absyn_walk.c, src/kern/desugar.c, src/kern/desugar_case.c, src/kern/desugar_decls.c, src/kern/error.c, src/kern/free_vals.c, src/kern/main.c, src/kern/parse.c, src/kern/semant.c, src/kern/symtab.c, src/kern/tokenize.c: Use variadic functions for the most common error functions instead of the hacked up crap I was using. [cd86f75b28d0] * src/kern/desugar.c, src/kern/desugar_decls.c, src/kern/free_vals.c: Handle free values in exception handlers as well. Exception handlers are a special case since they don't exactly create a new level of scope, so if the parent of anything is an exception handler then we need to go up and see what its parent is. [5069b8542cc9] * ISSUES: More problems. [32645e6e6431] * src/kern/absyn_walk.c: Check the record expression for real, since it could also be a value or exception value we need to check for bindedness. [887ef739fbdb] * src/include/error.h, src/include/memory.h, src/kern/absyn_printer.c, src/kern/absyn_walk.c, src/kern/desugar_case.c, src/kern/desugar_decls.c, src/kern/error.c, src/kern/semant.c, src/kern/symtab.c, src/kern/tokenize.c: Change MITCHELL_INTERNAL_ERROR so it spits out the file and line number of the real source file, not of the error function itself. [4a9efeea4986] 2005-07-08 chris * docs/typing: Update name scope explanation for current status of the code. [ed05dbe77ebf] * docs/lang-ref: Flesh out typing description further. Add explanation for the easier expressions. Long way to go still. [f3f483aa3319] * docs/grammar: A little consistency is always good. [f3bfcf9c85f6] 2005-07-07 chris * po/mitchell.pot, src/kern/error.c, src/kern/semant.c: More string modifications. [7aa2d82d6be5] * tests/list-001.mitchell: Updated test since we can't have empty lists yet. [5f160289bac5] * po/mitchell.pot, src/kern/semant.c: Fixed translation marking. [46fc041bf4e6] * tests/case-001.mitchell, tests/case-002.mitchell, tests/case-003.mitchell, tests/case-007.mitchell, tests/case-008.mitchell, tests/case-009.mitchell, tests/exn-006.mitchell, tests/exn-010.mitchell, tests/exn-011.mitchell, tests/function-004.mitchell, tests/function-005.mitchell, tests/function-007.mitchell, tests/function-008.mitchell, tests/function-010.mitchell, tests/function-011.mitchell, tests/function-012.mitchell, tests/if-002.mitchell, tests/if-006.mitchell, tests/module-001.mitchell, tests/module-003.mitchell, tests/module-005.mitchell, tests/rec-004.mitchell, tests/scope-002.mitchell, tests/scope-003.mitchell, tests/scope-007.mitchell, tests/scope-008.mitchell, tests/scope-011.mitchell, tests/type-002.mitchell, tests/type-005.mitchell, tests/type-006.mitchell, tests/type-007.mitchell, tests/type-009.mitchell, tests/type-013.mitchell, tests/type-014.mitchell, tests/type-016.mitchell: Update tests for new error messages. I can already see this was a bad idea. [540d678cafc8] * ChangeLog, Includes.mk, Makefile, README, po/Makefile, po/mitchell.pot, src/include/error.h, src/include/memory.h, src/include/parse.h, src/include/tokens.h, src/include/translate.h, src/kern/Makefile, src/kern/absyn_printer.c, src/kern/absyn_walk.c, src/kern/desugar.c, src/kern/desugar_case.c, src/kern/desugar_decls.c, src/kern/error.c, src/kern/free_vals.c, src/kern/main.c, src/kern/parse.c, src/kern/semant.c, src/kern/symtab.c, src/kern/symtab_printer.c, src/kern/tokenize.c: Completed internationalization prep work. I went through all the strings and modified them to make more sense, be complete sentences, and be easier to translate. I then marked them all so xgettext can pick them up and generate the .pot file. Added a directory for translations (there are none yet), makefile framework for handling LOCALEDIR, and documentation for new dependancies. [165602961f45] * src/kern/.cvsignore: Tired of seeing that message. [e675d4f94a12] * src/kern/main.c: Update copyright statement. [1b928cae1fd4] 2005-07-01 chris * run-tests.sh, src/kern/Makefile: Formatting changes. [e3a141b90e4b] * docs/writing-tests: A little documentation for the special formatting in test cases. [0930cbd84f2f] * TODO, run-tests.sh, tests/case-001.mitchell, tests/case-002.mitchell, tests/case-003.mitchell, tests/case-007.mitchell, tests/case-008.mitchell, tests/case-009.mitchell, tests/exn-006.mitchell, tests/exn-010.mitchell, tests/exn-011.mitchell, tests/function-004.mitchell, tests/function-005.mitchell, tests/function-007.mitchell, tests/function-008.mitchell, tests/function-010.mitchell, tests/function-011.mitchell, tests/function-012.mitchell, tests/if-002.mitchell, tests/if-006.mitchell, tests/module-001.mitchell, tests/module-003.mitchell, tests/module-005.mitchell, tests/rec-004.mitchell, tests/scope-002.mitchell, tests/scope-003.mitchell, tests/scope-007.mitchell, tests/scope-008.mitchell, tests/scope-011.mitchell, tests/type-002.mitchell, tests/type-005.mitchell, tests/type-006.mitchell, tests/type-007.mitchell, tests/type-009.mitchell, tests/type-013.mitchell, tests/type-014.mitchell, tests/type-016.mitchell: Use bash constructs in run-tests.sh instead of pretending to care about regular Bourne shell compatibility. For tests that are supposed to fail, add a reason why they should fail and check this against whatever messages the compiler emitted. [c78c54edc48b] * run-tests.sh, tests/echo-002.mitchell, tests/exn-003.mitchell, tests/fact-001.mitchell, tests/fib-001.mitchell, tests/fib-002.mitchell, tests/gcd-001.mitchell, tests/if-003.mitchell, tests/if-004.mitchell, tests/module-007.mitchell: Allow tests to be disabled (not run by the test suite). Now we don't have to see all those false failures caused by a lack of type information on standard library stubs. [f6b3f4f4fb64] 2005-06-30 chris * Makefile, run-tests.sh: Split test suite control out into a shell script since that's a whole lot nicer to work with than make. Why didn't I do this a long time ago? [c7ea8d3405bc] * TODO, src/include/absyn_walk.h, src/include/desugar.h, src/kern/Makefile, src/kern/absyn_walk.c, src/kern/desugar.c, src/kern/desugar_case.c, src/kern/desugar_decls.c, src/kern/free_vals.c: Replace all that redundant tree walking code in AST simplification with a generic set of functions that may be overridden on a per- function basis in each pass. This way, each pass only has to specify the functions it needs to get its job done and the rest can use the generic walking methods. It's not a completely generic tree walking framework because it doesn't pay attention to type nodes, case-exprs, and other things we don't look at in the simplification passes. [3399d173665e] * TODO, docs/mitchell.1, src/include/config.h, src/include/desugar.h, src/kern/Makefile, src/kern/desugar.c, src/kern/free_vals.c, src/kern/main.c: Added the beginnings of lambda lifting and free value analysis. This is simply done by looking up each identifier in the most local symbol table and if it's not found, reporting it as unbound. We are not yet doing anything about all the free values, and there's no way to turn off that reporting. [709073f58253] * src/include/absyn.h, src/kern/absyn_printer.c, src/kern/desugar_case.c, src/kern/desugar_decls.c, src/kern/parse.c, src/kern/semant.c: The parser ensures that a function's body is always a decl-expr, so enforce that in the AST types as well. [6edfb670241b] * src/kern/symtab_printer.c: Ignore SYM_NONE. [38a86932e322] * src/include/absyn.h, src/include/symtab.h, src/kern/absyn_printer.c, src/kern/desugar_case.c, src/kern/parse.c, src/kern/semant.c, src/kern/symtab.c: Added symbol tables to AST nodes representing new levels of scope as this information is needed for free value analysis later on. Added an identifying type to absyn_id_expr_t nodes so we know if they represent value identifiers that need to be looked up later. [d5f2bc6f1e04] 2005-06-24 chris * src/kern/main.c: Got the order of those parameters wrong. [98cac1389792] * src/kern/Makefile: Allow passing compiler options on the command line. This seems like an easy way to get back into the mitchell programming. [0a4b4a699bb8] 2005-05-05 chris * src/kern/semant.c: Correctly label the terminating symbol in a reference to something insided a module. [c77495f060d5] * src/include/absyn.h, src/kern/Makefile, src/kern/absyn_printer.c, src/kern/desugar_decls.c, src/kern/parse.c, src/kern/semant.c: Add symbol tables to function AST nodes after performing type checking. This information will be needed later to do free variable analysis as part of lambda lifting. [c6b534f697f6] * docs/lang-ref: Outlined. [f6b21def70fa] 2005-05-04 chris * src/kern/semant.c: Assign labels to more AST nodes, in particular the exception nodes. [389a8953a04e] * src/kern/symtab.c: Set the symbol's label to NULL if no label exists for the input, not the name. [555e584be09e] * src/kern/desugar_case.c, src/kern/desugar_decls.c: Make sure exception handlers make it into the simplified AST. [73f696d88d44] * src/kern/semant.c: Assign a label to exception values as well. [7a557457a272] 2005-04-27 chris * docs/mitchell.1, src/include/config.h, src/include/desugar.h, src/kern/Makefile, src/kern/desugar.c, src/kern/main.c, src/kern/rename.c: No need for a separate renaming pass since I think we can do everything in the parser or semantic analysis phases. [e711e1ecda8b] * src/kern/desugar.c, src/kern/desugar_case.c, src/kern/parse.c, src/kern/rename.c, src/kern/semant.c, src/kern/symtab.c, src/kern/symtab_printer.c: Add labels into AST nodes during semantic analysis since we still have symbol tables available and can look things up. Also, modified the symbol table output format to display the labels. I think this obsoletes the need for any separate renaming pass, so that's about to get the axe. [65fbfeb164f2] 2005-04-26 chris * SCHEDULE: Put another preview release in so we don't go so long without one (alternatively, I could just work faster). [6717c421f7d7] 2005-04-24 chris * src/include/desugar.h, src/kern/str.c: Add information for vim. [516227e8eb52] * src/include/symtab.h: Helps to know exactly what types are being stored in these lists. [f62d662b1210] 2005-04-21 chris * src/kern/desugar.c, src/kern/desugar_case.c, src/kern/desugar_decls.c, src/kern/str.c: Make the string uniquifying function more generic (str -> str instead of str -> absyn_id_expr_t) and create a new function to convert strings into AST nodes. [d19ef74c6de7] * src/include/desugar.h, src/include/str.h: Make the string uniquifying function more generic (str -> str instead of str -> absyn_id_expr_t) and create a new function to convert strings into AST nodes. [4e7845947483] * src/kern/Makefile: Delete core files. Dependancy fixups. [cf0295cb9e51] * src/include/absyn.h, src/include/str.h, src/include/symtab.h, src/kern/absyn_printer.c, src/kern/rename.c, src/kern/semant.c, src/kern/str.c: Changed prototype of unicode_to_ascii to later make it easier to use the return value for AST rewriting. [132b29bc93f9] 2005-04-12 chris * src/include/absyn.h, src/include/str.h, src/include/symtab.h, src/kern/Makefile, src/kern/absyn_printer.c, src/kern/parse.c, src/kern/rename.c, src/kern/semant.c, src/kern/str.c: Convert unicode strings representing mitchell identifiers into ascii strings representing assembler identifiers, and store these in the AST and symbol tables as well. [e044f04ca101] * src/kern/desugar.c: Change comments to reflect exactly what we're going to do. Change symbol prefix to be a valid character recognized by assemblers. [4a6225bac699] 2005-04-06 chris * ChangeLog, TODO, docs/grammar, src/kern/absyn_printer.c, src/kern/parse.c, src/kern/semant.c, tests/type-016.mitchell, tests/type-017.mitchell: Make type annotation on a value declaration optional. [7b376c1d404b] 2005-03-30 chris * ChangeLog, docs/mitchell.1, src/include/config.h, src/include/desugar.h, src/kern/Makefile, src/kern/desugar.c, src/kern/main.c, src/kern/rename.c: Added framework for the identifier renaming pass. [a896617a4337] 2005-03-29 chris * SCHEDULE: Minor schedule modifications required by exception merge. [b0ee916806e8] * ChangeLog, TODO, docs/exceptions, docs/grammar, docs/mitchell.1, editing/mitchell-syntax, editing/mitchell-vimrc, src/include/absyn.h, src/include/config.h, src/include/desugar.h, src/include/error.h, src/include/list.h, src/include/semant.h, src/include/str.h, src/include/symtab.h, src/include/tokens.h, src/kern/Makefile, src/kern/absyn_printer.c, src/kern/desugar.c, src/kern/desugar_case.c, src/kern/desugar_decls.c, src/kern/list.c, src/kern/main.c, src/kern/parse.c, src/kern/semant.c, src/kern/str.c, src/kern/symtab.c, src/kern/symtab_printer.c, src/kern/tokenize.c, tests/exn-001.mitchell, tests/exn-002.mitchell, tests/exn-003.mitchell, tests/exn-004.mitchell, tests/exn-005.mitchell, tests/exn-006.mitchell, tests/exn-007.mitchell, tests/exn-008.mitchell, tests/exn-009.mitchell, tests/exn-010.mitchell, tests/exn-011.mitchell, tests/type-015.mitchell: Merged exception branch back into HEAD, after fighting with CVS for a while. I hope this was a clean merge. Note that BRANCH_EXN is now closed and will see no more active development, unless I come up with something crazy and new regarding exceptions. [163162b9697a] 2006-06-23 chris * .hgtags: Added tag PRE_EXN_MERGE for changeset bb3dfe537b0bbabaaf8794e14738851bdb3ebe95 [a385b3e2c8a2] 2005-03-29 chris * TODO: Always something else to do. [bb3dfe537b0b] [PRE_EXN_MERGE] 2005-03-11 chris * src/kern/main.c: Merge in fix from exception branch for C's stupid fall-through case statement causing certain combinations of command line options to not work. [8a0f7ab27a6d] 2005-03-09 chris * Makefile, TODO, src/kern/Makefile: Merged in generic makefile improvements off the exception branch. [5e764c9b6d41] 2005-03-02 chris * TODO: So much to do and so little time. [91905bfcfb2d] 2005-02-20 chris * src/kern/desugar_decls.c: No longer need to handle case-exprs, as those have been eliminated. Add a default case in, just in case something weird happens. [9787e5d3f8d0] * src/kern/desugar_case.c: Convert a case-expr into a series of chained if-exprs, therefore eliminating case-exprs from the AST. We won't have to deal with them anymore after this simplification pass. [b54794de8d9c] * TODO: I've already added plenty of options for dealing with printing out desugared ASTs. [148c4cc9ceb9] * src/include/semant.h, src/kern/semant.c: We need unalias() elsewhere. [36abd52ae10e] 2005-02-12 chris * ChangeLog, docs/mitchell.1, src/include/config.h, src/kern/desugar.c, src/kern/main.c: Added additional options to -last-phase to halt compilation after various AST simplification passes. [93a94ab4e1b3] * ChangeLog, src/include/absyn.h, src/include/config.h, src/include/desugar.h, src/include/error.h, src/kern/Makefile, src/kern/absyn_printer.c, src/kern/desugar.c, src/kern/desugar_case.c, src/kern/desugar_decls.c, src/kern/main.c, src/kern/parse.c, src/kern/semant.c, src/kern/symtab.c, src/kern/tokenize.c: One of those overlapping commits I hate so much. - Renamed the compiler_config variable to cconfig as that was getting to be entirely too much to type. - Changed print_absyn to take a header argument as well. We're going to use that to print out the AST after each phase of tree simplification, so this will make it easier to tell what's what. - Added the first bit of case-expr simplification, which currently only handles cases with just a default-expr. [122efc3556ba] 2005-02-11 chris * ChangeLog, docs/lang-ref: Added the beginnings of a language reference manual, since some people don't read specifications and code. [57e0080cc0c9] * ChangeLog, src/kern/tokenize.c, tests/hello-002.mitchell: Strings may now be continued across multiple lines Tiger-style by putting a backslash at the end of one line and another before the first in-string character of the following line. [b72c477e63e2] * src/kern/desugar_decls.c, src/kern/parse.c: Give all functions an explicit decl-expr as their body if they do not have one, moving the existing body inside the decl-expr. This eliminates a potential third subcase to deal with in promoting decl- exprs and can be easily cleaned up later if they do not end up with any decls. [e09eb40af756] * ChangeLog, TODO, src/include/absyn.h, src/include/desugar.h, src/kern/Makefile, src/kern/absyn_printer.c, src/kern/desugar.c, src/kern/desugar_decls.c, src/kern/main.c, src/kern/parse.c: Here goes the first step in the next phase - AST simplification. This first part converts certain decl-exprs into functions that will eventually be lifted up to the top level of the enclosing module. We do this to flatten out the nested structure of the input source file. The key to all this conversion is backlinks in the AST which the parser now adds. See comments in the desugar* files for explanations. This is only a little tested - in particular the backlink fixups on converting the decl-exprs and dealing with their children nodes. [616a9dc1fed2] 2005-02-09 chris * src/kern/absyn_printer.c: Die if we ever get into one of these default cases. If I'd known this was happening, it would have made debugging a lot easier. [e74c00dd99d7] 2005-02-08 chris * src/kern/str.c: Start the string properly so libgc can handle it. [1585e95bacc7] * src/include/str.h, src/kern/str.c: Added a generic string handling library. Only one thing in there right now but that'll increase as I look through the rest of the source. I can't do that right now due to other pending commits. [1e4f2f17d3ae] 2005-02-02 chris * src/include/list.h, src/kern/list.c: Added patches from Mike to provide support for reversing a list and for proper compilation under C++. [c9eb0befbb0b] * src/kern/absyn_printer.c: Can't close stdout. [2bafdc835316] 2006-06-23 chris * .hgtags: Added tag PREVIEW_4 for changeset 85fe2c386e56e4f4854967296668717fd04afa76 [c5e6b98b5a6f] 2005-01-22 chris * ChangeLog, src/include/basic_types.h, src/include/version.h: Updated miscellaneous files for release. [85fe2c386e56] [PREVIEW_4] * TODO, src/kern/symtab.c: Use a better hash function than that cheesy thing I came up with. [fe3aaa16bcd4] * ChangeLog, TODO, src/include/absyn.h, src/include/error.h, src/include/symtab.h, src/kern/absyn_printer.c, src/kern/parse.c, src/kern/semant.c, tests/type-013.mitchell, tests/type-014.mitchell: Detect infinite loops in type definitions and throw an error if one is encountered. [22ee3734db0a] 2005-01-21 chris * TODO, src/kern/semant.c: Don't allow overridding the base types (which appear in the global environment). [87ddbca39771] 2005-01-19 chris * TODO, src/kern/parse.c: The else-expr must come last in the case branch list. This completes the test case audit. [0bc14464bb01] * src/include/error.h, src/kern/main.c, src/kern/semant.c, src/kern/tokenize.c: Cleaned up error reporting macros. Added an error message specific to the case where length of a formal argument list does not match the length of the parameter list, instead of a generic error. [2c760068672d] * tests/case-007.mitchell: Updated test case to correct unknown symbol problem which was masking what the case was supposed to be testing. [c92d165a5dd4] 2005-01-18 chris * ChangeLog, Makefile, docs/mitchell.1, src/include/config.h, src/include/error.h, src/kern/main.c, src/kern/semant.c: Added -Werror to treat warnings as errors and kill compilation. Also, add this as a default option for "make test". [d7c39d8a21b7] * tests/case-004.mitchell: Updated test to have exhaustive matching on case branches. [aedabec9111d] * ChangeLog, TODO, src/include/error.h, src/kern/semant.c: Throw an error on case-exprs without default expressions if the branches are integers or strings, and throw a warning if the branches are booleans. This is because case is an expression and must return a value, so we have to make sure all possibilities are covered. [981108a5fa41] 2005-01-17 chris * tests/case-004.mitchell, tests/if-005.mitchell: Add else branches to the case statements that need them in order to make tests which should pass continue to do so. [35d8d4c6a267] * ChangeLog, TODO, docs/grammar, src/include/absyn.h, src/kern/absyn_printer.c, src/kern/parse.c, src/kern/semant.c, tests/rec-006.mitchell: Allow function calls which return records to have elements referenced in one expression, instead of first having to assign the return value to an identifier and then lookup an element in that. [11239a2384fb] 2005-01-16 chris * src/kern/absyn_printer.c: Fixed printing out the AST that got screwed up when converting to the generic list code. [5b382562029b] 2005-01-14 chris * ChangeLog, TODO, src/kern/tokenize.c: Added escape sequences to string literals. [8ade1fb4772a] 2005-01-10 chris * README: Typo fix. [51e67747b624] * ChangeLog, TODO, docs/mitchell.1, src/include/config.h, src/kern/main.c: Added -last-phase option to halt compilation early. [987ecb2dea9b] * ChangeLog, TODO, src/include/absyn.h, src/include/error.h, src/include/tokens.h, src/kern/parse.c, src/kern/semant.c, src/kern/tokenize.c: Added column numbers to error reporting. [650799c6d42a] * ChangeLog, TODO, src/include/absyn.h, src/kern/absyn_printer.c, src/kern/parse.c, src/kern/semant.c: Use generic linked list code everywhere instead of reimplementing lists when they're needed. Unfortunately, this had negligible impact on code and executable size. Hopefully it'll at least be simpler or easier to maintain or something. Killed a lot of AST types, too (see ChangeLog). [2bd583e25bd6] * src/kern/Makefile: Added dependancies on header files for easier rebuilding. [5b3312a1e95b] 2005-01-09 chris * src/kern/list.c: Take special steps to delete things if we're dealing with singleton lists. [19aac3ef6584] 2006-06-23 chris * .hgtags: Added tag PREVIEW_3 for changeset 3e0fd546b5c1d2e905e2063324a731aff3271528 [554611e6961f] 2005-01-08 chris * ChangeLog, README, SCHEDULE, TODO, docs/mitchell.1: Documentation updates for preview release 3. Correct or not, this is getting pushed tonight. [3e0fd546b5c1] [PREVIEW_3] * ISSUES: Something to track currently open problems. [d9a2d93a8714] 2005-01-07 chris * TODO, docs/mitchell.1, src/include/config.h, src/include/symtab.h, src/kern/absyn_printer.c, src/kern/main.c, src/kern/semant.c, src/kern/symtab.c, src/kern/symtab_printer.c: Changed the symbol table output option to -Idump-symtab for better parallism with -Idump-absyn. Also allow it to write to a file, user-specified file, or stdout. [2e58ea353611] * TODO, docs/grammar, docs/typing, src/include/absyn.h, src/kern/absyn_printer.c, src/kern/parse.c, src/kern/semant.c: Bottom is now also an expression, allowing you to make values of type bottom and return it from functions. It is not allowed in case expression tests since that's an exception to all the other typing stuff anyway. [2f7d59b35eb2] * docs/grammar, src/include/absyn.h, src/include/tokens.h, src/kern/absyn_printer.c, src/kern/parse.c, src/kern/semant.c, src/kern/tokenize.c: Added the bottom type, though there is currently no way to create any variable of this type or return it since there's not yet a bottom expression. Bottom behaves much like unit did in ML. [7109a8d7ac6a] * editing/mitchell-vimrc: Added a shortcut for typing bottom. [341ba152fe51] * TODO: More things to work on. [f282788bc413] 2005-01-05 chris * docs/typing, src/kern/semant.c: Changed the rules for scoping and recursive definitions to be closer to the Tiger compiler (see docs/typing for details). These new rules are more strict which actually makes the implementation easier. It also has the pleasant side effect of throwing an error when one of our standard library shims is referenced instead of segfaulting. [d3b67e0cb8c0] * TODO: Did that. [55bc5c0e15fa] * tests/function-016.mitchell, tests/scope-011.mitchell, tests/scope-012.mitchell, tests/type-011.mitchell, tests/type-012.mitchell: Added tests for new scoping rules. [886d8efec147] * src/kern/symtab.c: Reference the right variable when adding function entries to rows that already have elements. This fixes a segfault. [e6ac61792c51] 2004-12-24 chris * tests/rec-005.mitchell: Test combining record element access and module access. [0f0ca211baa2] * tests/type-010.mitchell: I don't know if I have a recursively defined type test or not. [5a72b2c9f505] 2004-12-23 chris * src/kern/symtab_printer.c: Make function output more interesting. [4517937970a2] * tests/list-001.mitchell: Uncomment the part that fails, since we need to be looking at that anyway. [fd4da1cb69a7] * tests/function-012.mitchell: Corrected what was expected. [91697a0ec346] * tests/rec-001.mitchell, tests/rec-004.mitchell: Fixed a typo in Mike's record test, and then made a new test out of what was being caught. [5d3b84e79f58] * tests/function-009.mitchell, tests/function-010.mitchell, tests/function-011.mitchell, tests/function-012.mitchell, tests/function-013.mitchell, tests/function-014.mitchell, tests/function-015.mitchell: Lots of test cases for function calls, argument lists, and so forth. [545ea7d61e48] 2004-12-22 chris * tests/echo-001.mitchell, tests/echo-002.mitchell: Added more tests from Mike. [4c70b91b9f04] * tests/rec-003.mitchell: Fixed typo. [e548ab198b12] * tests/case-002.mitchell, tests/case-008.mitchell, tests/case-009.mitchell, tests/case-010.mitchell: Tests for the type checking on case expressions. [d9d460d3cd1c] * tests/rec-002.mitchell, tests/rec-003.mitchell: Test record element access. [42ed4862e787] * tests/rec-001.mitchell: Typo fix. [dbe4dd7f6db0] * src/kern/symtab.c: Make sure to put functions and values in the same namespace. [9bad87514a80] * ChangeLog, TODO, docs/grammar, src/include/absyn.h, src/include/tokens.h, src/kern/absyn_printer.c, src/kern/parse.c, src/kern/semant.c, src/kern/tokenize.c: Added element member access, which required addition of a new piece of syntax. Instead of using the dot to separate value from element, I'm now using the pipe. This is to help differentiate between records and methods and make the grammar a little more clear. Also, added some utility type checking functions like unalias(). [33b194f89dde] * tests/case-004.mitchell, tests/if-001.mitchell, tests/if-005.mitchell: Fixed type problems in a couple test cases caused by my laziness when I first made them up. [a20bc19ec872] * tests/list-001.mitchell: Updated list test from Mike. [e0c5943f6c88] * src/include/symtab.h, src/kern/symtab_printer.c: Added a function to dump a single symbol, since this could be handy information elsewhere. Prettied up the symtab printer output just a bit, too. [53313e40499f] 2004-12-21 chris * src/kern/Makefile: Don't build with optimizations if we're also debugging. That's a bad combination of flags right there. [8bc469c5c5a5] 2004-12-20 chris * src/include/list.h, src/kern/list.c: Added a function to find an element in a list. I can't believe I didn't have one of those before. What exactly did I intend to do in the manos kernel about that? [185bb2c1b626] 2004-12-19 chris * src/kern/semant.c: Added function call support. This, like everything else, needs testing. [d9c7c1478a29] * README, src/kern/Makefile: Finally added a way to make a debug build, so I don't keep accidentally commiting changed Makefiles. [f5cc232380ac] 2004-12-18 chris * src/include/absyn.h, src/kern/absyn_printer.c, src/kern/parse.c, src/kern/symtab.c: Broke the AST function call representation out into its own type, which required a couple minor changes across the parser and other AST handlers. Also, add the right information for a function symbol into the symbol table. [d4ce78c7130f] 2004-12-17 chris * src/kern/semant.c: Type checker now has code to handle everything except function calls and value references, since those are going to be a little difficult. Note that this isn't tested code, just code. [e4200ce77077] * SCHEDULE: Added an outline of what I want to be in each stage of the compiler, for planning purposes. Maybe this will keep me focused on what to do next. [cc621d9e2429] * tests/rec-001.mitchell: Added another test case from Mike. This test suite's starting to get pretty large, but there's so much more that could be in it. [ffc79315d2e6] * src/include/symtab.h, src/kern/Makefile, src/kern/semant.c, src/kern/symtab.c: Use list_t for some of the symbol table stuff as a test to see if it'll work everywhere. Don't use "new" as that's a C++ keyword. Worked on type equality a bit more. [b4bc3ee6568b] * TODO: All sorts of TODO list updates and rearranging. [b99556d2b6b5] 2004-12-15 chris * src/include/semant.h: Applied a patch from Mike to allow C++ linkage. [9a1a1d37daf4] * tests/list-001.mitchell: Added another test case from Mike. This one looks like fun. [1336af293fcc] * src/include/list.h, src/kern/Makefile, src/kern/list.c: Added my generic linked list manipulation code from manos, with a couple minor modifications. I wish I'd remembered this earlier. I'm now going to add it in all over the place since doing my own linked lists repeatedly has been a huge pain. [50623b9b5b35] 2004-12-14 chris * src/include/absyn.h, src/include/error.h, src/kern/absyn_printer.c, src/kern/parse.c, src/kern/semant.c: Beginnings of support for value and function declarations, as well as equality testing of types. Also, changed the names of the function AST node's components to line up more with the function symbol's components. [9fc62e1afe11] 2004-12-13 chris * docs/typing: Documented the scope rules a little bit. This could probably use some further explanation, though. [c0e3cb6b7f19] * TODO: More TODO list changes. [0363589b3e8a] 2004-12-12 chris * src/include/absyn.h, src/include/basic_types.h, src/include/semant.h, src/include/symtab.h, src/kern/semant.c, src/kern/symtab.c, src/kern/symtab_printer.c: That first attempt at writing a type checker didn't work out so well. I got most of the way into it and decided I no longer understood exactly what was going on, nor could I figure out how to make new type definitions work right. So I decided on a rewrite. This is the first commit on that rewrite that only supports adding new types. In retrospect, that should have been the first thing I did in the type checker. Unfortunately, this commit is a bit of a mess since it's such a drastic change. Hopefully the next one will be more sensible. [a1ba515d47c4] * TODO: Finally, some more updates. [d510adda1631] 2004-12-07 chris * src/include/version.h, src/kern/main.c: Added a version information header for Mike. [aff0888bccf1] 2004-12-02 chris * TODO, src/include/memory.h, src/kern/main.c, src/kern/parse.c, src/kern/semant.c, src/kern/symtab.c, src/kern/tokenize.c: Changed MALLOC and REALLOC macros to take a semicolon after the closing paren, since vim's syntax definition likes that a whole lot more. [c3973adeee7f] * TODO, src/include/error.h, src/kern/semant.c: Made type checker error handling macro much better. [90f73b93aabe] * ChangeLog, docs/grammar, src/include/absyn.h, src/kern/absyn_printer.c, src/kern/parse.c, src/kern/semant.c, tests/scope-004.mitchell, tests/type-001.mitchell, tests/type-004.mitchell: Allow lists of lists and more complicated nested list types. This was actually a bug in the grammar itself, so I had to go back and change that before doing anything else. Actually, the grammar ended up getting a little simplified because I killed the single-ty rule. One major advantage to having to look at this bug is that I was able to overhaul that awful absyn_ty_t structure. [f922a45297e5] 2004-12-01 chris * src/include/basic_types.h, src/include/semant.h, src/kern/semant.c, src/kern/symtab_printer.c: Basic lists can now be type checked. This is just values that are lists of one of the basic types. Lists of lists are not allowed by the grammar (whoops), still no support for aliases, and so forth. While I was at it, I added a function to convert types into strings so they can be printed as part of a more descriptive type checker error message. Still lots and lots of work to do. [1cb7a2d6fe90] * tests/hello-001.mitchell: Look at all those funky characters. [c0711c005d02] * TODO: More stuff that Mike would like done, plus some timeframes. [977d8f953410] 2004-11-30 chris * src/kern/semant.c: Fixed type checking on default case branches. [4089c4577b89] * src/kern/symtab_printer.c: Print out the basic type information we currently support. [e7dfb9e67574] * src/kern/semant.c: Basic value declarations (for boolean, integer, and string types) now pass the type checker and should have their type information entered into the symbol table/AST. I suppose I should add some code to stringify types and then have the AST printer display those. [5820dc03f820] * src/include/symtab.h, src/kern/semant.c, src/kern/symtab.c: Changed the symtab API to make more sense - we don't need to pass in symbols to the searching functions, since the only times I'm ever using them, I don't have a symbol laying around. [5d890bb620f4] * TODO, src/include/absyn.h, src/include/basic_types.h, src/include/error.h, src/kern/absyn_printer.c, src/kern/parse.c, src/kern/semant.c: First parts of the type checker - some basic type checking of expressions that doesn't work yet and renaming unrelated components so they don't sound like they have anything to do with types. [3554dc970fa8] 2004-11-25 chris * docs/typing: Added a big comment to the top, just in case it wasn't clear what you were looking at. [2399816f7a21] * docs/typing: Added type equivalence rules and a notes section describing exactly what those rules mean, in case you don't understand. [3fcf336f281d] * docs/typing: It's about time I added these type checking rules, since I'm almost up to the type checker. [283a260f10e9] * src/include/error.h, src/kern/absyn_printer.c, src/kern/main.c, src/kern/parse.c, src/kern/semant.c, src/kern/tokenize.c: First step towards a more unified error reporting framework. At least all the messages look similar now. The next piece of this is to have all the error messages travelling into one output function. [c3bcf10ad122] 2004-11-24 chris * src/include/absyn.h, src/include/basic_types.h, src/include/tokens.h, src/kern/semant.c, src/kern/symtab.c, src/kern/symtab_printer.c, src/kern/tokenize.c: Changed the definition of an mstring_t to no longer include the pointer part. I have no idea why I did that - I never do. Anyway, that allowed me to kill a whole bunch of casts between mstring_t and wchar_t so the code is better now. [a3aaeb590fd9] * TODO: Hey look, I actually removed some things without adding anything new. [3d95bf9029fe] * docs/mitchell.1, src/include/config.h, src/include/symtab.h, src/kern/Makefile, src/kern/main.c, src/kern/semant.c, src/kern/symtab.c, src/kern/symtab_printer.c: Add a system for printing out symbol tables when exiting levels of scope or completing checking modules, complete with a new option (-Idump-symtabs) that will dump the tables on stdout. This will soon change to take an optional file name, but the important thing is getting the framework in place throughout the symtab building code. [0667c7e86bbb] * tests/function-008.mitchell, tests/module-006.mitchell, tests/module-007.mitchell, tests/scope-005.mitchell, tests/scope-006.mitchell, tests/scope-007.mitchell, tests/scope-008.mitchell, tests/scope-009.mitchell, tests/scope-010.mitchell, tests/type-008.mitchell, tests/type-009.mitchell: Bunches of test cases related to scope, nested modules, and the like. There's probably tons more that could be written but I can't do any of that right now. [502eebcb4ccd] 2004-11-23 chris * TODO: Always growing, never shrinking. [b95ec935116c] * tests/case-002.mitchell, tests/case-004.mitchell, tests/case-005.mitchell, tests/case-006.mitchell, tests/if-007.mitchell: Cleaned up the test cases so they all do what they're supposed to again. This just comes from me not caring about things being valid identifiers when writing up parser tests. There'll be another round of this once type checking works. [79271ca7156e] * tests/scope-003.mitchell, tests/scope-004.mitchell: Test the module, type, function/value namespacing in the symbol table. [3d6962005519] * tests/type-007.mitchell: Make sure you can't have a record with duplicate field names. [bf4fd214f2ec] * src/kern/semant.c: Added enough symbol table support for records to get it to the same status as everything else - record types are entered into the symbol table, fields have their types "checked" (well, kind of), and field names are checked for duplicates. [8a59f20df9e4] * src/kern/semant.c: Add type identifiers into the environment as well so more tests work. Also, corrected a stupid typo. [5fd1c0687fa9] * tests/scope-001.mitchell, tests/scope-002.mitchell: Let's start testing scope of value names. [6d8bed41fa15] * src/kern/semant.c: (1) Removed the table stack parameters from the error handling functions. I'll come up with a better way to print out symbol tables later, but this is not the way to do it. (2) Added in hardcoded skeleton Boolean and Integer modules - just enough to make "make test" happy with the current test suite. This is really just temporary stuff, but I don't want to get stuck on trying to load multiple modules forever. [034a00087696] 2004-11-21 chris * TODO: Updated TODO for current stage of symbol table work. [10235633fc2e] * README: Make the README a little less specific as to what mitchell can do so we don't have to change it so often. [831b1e4780b6] * ChangeLog: A ChangeLog sure would be helpful in letting other people know some of the stuff I've been up to. [a86ec29acc42] * src/kern/semant.c: Major changes relating to modules and namespacing. The big change was completely redoing check_id, transforming it from a function that added symbols to tables into a function that only performs lookups in the appropriate places. The mechanism for this is well documented in the check_id comments. The burden for adding symbols has now been distributed all over the place since there are a couple different cases to consider. Unfortunately, I've now basically hit a wall where I need to decide how multiple files will work, how to load symbol tables out of precompiled modules, and so forth. I can't even run my test cases anymore since there's no standard library so Integer is an undefined symbol in each test. Oh, I also worked on the error reporting functions some and finished off the last bits of the symbol table stack function arguments. [45f9f5c11825] * src/include/absyn.h, src/kern/absyn_printer.c, src/kern/parse.c: I thought the absyn_id_expr_t went from most specific up the path to least specific, but it actually goes the other way. That is, the parent module absyn_id_expr_t nodes are really the parents of their children. So it doesn't make sense to call the pointer "ns" since it's really referrring to a module or value within the current module. [ea4ce550331b] * src/include/symtab.h, src/kern/symtab.c: Added lookup_entry which does basically everything that table_entry_exists did, but has a different return value. In fact, the latter is now written in terms of the former. Each value is needed in certain places. [f3b95a0edd7b] * tests/fact-001.mitchell, tests/fib-001.mitchell: Still don't know my base types. Interestingly, my semantic analysis work-in-progress turned up these typos. Hooray for things working correctly. [dd9cbc633d5c] * src/kern/symtab.c: Make sure to copy the symtab stack link, if it exists. [8bf1009fb7d2] * src/kern/semant.c: In preparation for having all the modules have their own symbol tables, pass a symtab stack variable around into each type checker function. Also, added a base environment containing types and value names, and populate the global table with this environment prior to checking the module list. [c25a572edb9d] * src/include/symtab.h: Since we've got three namespaces in the same table, make the table dump output more descriptive. [4ba1308da6b0] 2004-11-18 chris * src/kern/symtab.c: Pretty up the output on symtab_dump. [c231b024f981] * src/include/symtab.h, src/kern/symtab.c: Added symbol table printing functions, changed return value on table_add_entry so we can catch duplicate symbols and handle them elsewhere, reordered functions to make more sense, and properly copy new symbol information so we can use string literals in the source. [aead39fc9fe6] * TODO, src/include/absyn.h, src/kern/parse.c, src/kern/semant.c: Copy line numbers from tokens into the AST nodes when building it, which allows us to reference where unknown symbols are being used. Hooray for better error reporting. Now if only symbols were being added into the symbol table so I wouldn't see this message. [873995cb2fbf] 2004-11-14 chris * src/kern/Makefile, src/kern/symtab.c: Fixed core dump, though symbols are still not getting inserted into the table. This will be something stupid, I'm sure. This is the perfect opportunity to get working on unknown symbol error messages, which I think takes me back into the parser for more work. [0c439220e31f] * TODO, src/include/semant.h, src/include/symtab.h, src/kern/Makefile, src/kern/main.c, src/kern/semant.c, src/kern/symtab.c: Beginnings of the symbol table portion of semantic analysis - wrote up management functions and the AST walking functions that will do all the hard work. There's also the beginnings of adding symbols into the table, but that currently core dumps when run. Mainly, I'm committing this unfinished stuff because I'm about to go out of town and want to save my progress. [1b6e8c26074b] * src/include/absyn.h: I keep forgetting to duplicate these type names. [a1498ed0cd44] * src/include/absyn.h: That was a stupid typo. [310ce29b1f27] 2004-11-13 chris * docs/mitchell.1, src/kern/Makefile, src/kern/absyn_printer.c, src/kern/main.c: Changed default AST printing behavior to be off by default. Also added the option to print the AST on stdout. This must mean we're about to move on to symbol table and semantic analysis stuff. [d950a011e606] 2006-06-23 chris * .hgtags: Added tag PREVIEW_2 for changeset cecc72c6b15b1f0e00fedb4852d572615ba7280b [afc8c4558636] 2004-11-13 chris * src/kern/parse.c: Got rid of a warning. [cecc72c6b15b] [PREVIEW_2] * editing/mitchell-syntax: Bottom's a valid type. [add1efd903a0] * src/kern/Makefile: Added a patch from Mike to link against libdl.so. This is sometimes needed because libgc can optionally be built against it, and linking it in always doesn't do any harm. [3e8fb13cb95d] 2004-11-11 chris * src/kern/tokenize.c: Made fgetwc/ungetwc error messages more descriptive and helpful. [a549dcbf2c05] * TODO: The TODO list shrinks for once. [6308c118486e] * editing/mitchell-syntax: Added a preliminary vim syntax highlighting file. It currently highlights all the keywords and types, and recognizes errors with delimiters. [eaa1bee390f7] * editing/mitchell-vimrc: Also set the filetype. This will be useful soon when I have a syntax file. [3472dbe1de6f] * docs/grammar, src/include/absyn.h, src/kern/absyn_printer.c, src/kern/parse.c, tests/module-004.mitchell, tests/module-005.mitchell: Modules may now be nested within each other, but with one major exception: module declarations are only allowed in the top-level of a module. That is, they may not be declared inside a function, decl-expr, and so on.  Added a couple tests for this sort of thing. Still no good ideas on declaring visibility yet. [b3d7fbc47e2d] * tests/module-003.mitchell: Check to make sure we're not still accepting that old busted grammar. [a44932a40b6c] * docs/grammar: Simplified grammar by removing prototypes. Too bad this new simplicity won't last for long. [24b0ef89caad] * tests/case-001.mitchell, tests/case-002.mitchell, tests/case-003.mitchell, tests/case-004.mitchell, tests/case-005.mitchell, tests/case-006.mitchell, tests/case-007.mitchell, tests/fact-001.mitchell, tests/fib-001.mitchell, tests/fib-002.mitchell, tests/function-001.mitchell, tests/function-002.mitchell, tests/function-003.mitchell, tests/function-004.mitchell, tests/function-005.mitchell, tests/function-006.mitchell, tests/function-007.mitchell, tests/gcd-001.mitchell, tests/if-001.mitchell, tests/if-002.mitchell, tests/if-003.mitchell, tests/if-004.mitchell, tests/if-005.mitchell, tests/if-006.mitchell, tests/if-007.mitchell, tests/module-001.mitchell, tests/module-002.mitchell, tests/type-001.mitchell, tests/type-002.mitchell, tests/type-003.mitchell, tests/type-004.mitchell, tests/type-005.mitchell, tests/type-006.mitchell, tests/type-007.mitchell: Updated to reflect prototypes being removed. [8c444c0b54ff] * src/include/absyn.h, src/kern/absyn_printer.c, src/kern/parse.c: Removed prototype sections from module definitions as the first change required for nested module support. Having these prototypes meant that people would have to keep repeating the same definitions over and over again for nested modules. Eventually, I will use some sort of keyword or symbol in each definition to indicate visibility. [23e3634d8724] 2004-11-01 chris * docs/grammar, src/include/absyn.h, src/kern/absyn_printer.c, src/kern/parse.c, tests/case-005.mitchell, tests/case-006.mitchell, tests/case-007.mitchell: You can now have a default branch in the case expression. This branch must currently come at the end of all the ones you specify. Also, you can have a branch list composed of just the default. [7d03310991b5] * Makefile: If we failed because of a core dump, that's really important and we should make special mention of it. [8fd05bbdc26c] * tests/case-001.mitchell, tests/case-002.mitchell, tests/case-004.mitchell, tests/if-001.mitchell, tests/if-002.mitchell, tests/if-003.mitchell, tests/if-005.mitchell, tests/if-006.mitchell, tests/if-007.mitchell: Still don't know my basic types. true -> t, false -> f. [3e156de49bbd] * tests/case-001.mitchell, tests/case-002.mitchell, tests/case-003.mitchell, tests/case-004.mitchell, tests/fact-001.mitchell, tests/fib-001.mitchell, tests/fib-002.mitchell, tests/function-001.mitchell, tests/function-002.mitchell, tests/function-003.mitchell, tests/function-004.mitchell, tests/function-005.mitchell, tests/function-006.mitchell, tests/function-007.mitchell, tests/gcd-001.mitchell, tests/if-001.mitchell, tests/if-002.mitchell, tests/if-003.mitchell, tests/if-004.mitchell, tests/if-005.mitchell, tests/if-006.mitchell, tests/if-007.mitchell, tests/module-002.mitchell: Apparently I don't know my own basic types. int -> integer [eca757f9bc4c] * src/include/absyn.h, src/include/parse.h: Made changes to make C++ programs compile against certain mitchell headers, since Mike needs those modifications for his projects. [2bf432e7f0af] 2004-10-29 chris * src/kern/parse.c: Use a function to print out the expected sets, rather than having to update them in two places. Why didn't I think of this sooner? [219d88628fa5] * tests/gcd-001.mitchell: Mike alerted me to a problem with the runtime library I've been making up (since he's been working on his translator and needs actual correct information). Fixed. [3f0c2f4f86b7] * TODO, docs/grammar, src/include/absyn.h, src/kern/absyn_printer.c, src/kern/parse.c, tests/type-001.mitchell, tests/type-003.mitchell, tests/type-004.mitchell, tests/type-007.mitchell: Fixed a glaring inconsistency in the prototype section of modules - values and functions had been fully described, but types were only mentioned. The rationale for the first two was that client code would know exactly what it was dealing with. Clearly, this same rationale holds for types as well. This also simplifies the grammar somewhat (though this will change once nested modules are allowed). [99089ce1f190] 2004-10-28 chris * TODO, src/kern/main.c: I learned how to check for a UTF-8 aware locale, so now we can quit if we aren't able to read the input file instead of throwing a weird error message. [978ecb915d67] * TODO: It seems like lists only grow. [c338f746513f] 2004-10-26 chris * src/kern/main.c: Modified some very minor things. We're about to roll out a Preview 2 release here right after I tar this up and send it to Mike for comment. [b7e99a94cf66] * src/kern/absyn_printer.c, src/kern/parse.c: Added some more comments. Exciting. [02d8ce72cbdb] * README, docs/mitchell.1, src/include/config.h, src/kern/absyn_printer.c, src/kern/main.c: We now have another debug option: -Idump-absyn to print out the abstract syntax tree. This is just a bit of planning ahead. For now, you always get the AST even without this option. This option just allows you to control where it goes - you can specify an output file, supressing the stdout printing. When we have later phases done, the default behavior will change to not print out the AST. Also, I shortened up the names of all those printing functions to match what's getting output since absyn_ really just goes without saying. [07112573bf2d] * src/include/absyn.h, src/kern/parse.c: Use absyn_id_expr_t everywhere a symbol is needed instead of mixing and matching the two. This means the only place an actual mstring_t exists is in the absyn_id_expr_t AST node. The AST is now much more regular. [daf61ab19063] 2004-10-25 chris * src/kern/absyn_printer.c: Removed the absyn_ from the front of every outputted type because that goes without saying and makes it hard to tell everything apart at first glance. [f8ef76b280d2] 2004-10-24 chris * src/include/absyn.h, src/kern/Makefile, src/kern/absyn_printer.c, src/kern/main.c: First run AST printer. I think there's a good bit of work to do still on the output format to make it more helpful, but the structure's there. It's also currently enabled by default while I work on debugging the AST but will eventually be disabled by default and get a command line option. [8483f1348b3e] * src/include/absyn.h, src/include/parse.h, src/kern/main.c, src/kern/parse.c: Completed the types and AST building. Unfortunately, I started from the bottom of the tree instead of the top so I have not been able to test anything out. That means the next thing I need to write is an AST pretty printer so I can then debug the entire mess of code in one go. Next time, I'll remember not to be so stupid. [6ff253cedc58] 2004-10-23 chris * docs/grammar, src/include/tokens.h, src/kern/parse.c, src/kern/tokenize.c: They're called values now, not variables. Since there's no way to modify a variable once it's been created, it's not really a variable. This is just a renaming - nothing really changed. [4aa609561d3e] * docs/grammar, editing/mitchell-vimrc, src/include/tokens.h, src/kern/parse.c, src/kern/tokenize.c, tests/const-001.mitchell, tests/const-002.mitchell, tests/const-003.mitchell, tests/const-004.mitchell, tests/const-005.mitchell: There's no need for constants, since the grammar doesn't allow any sort of assignment to a variable except in its declaration. Therefore, constants are removed. [8a0233b5e847] 2004-10-22 chris * src/include/absyn.h, src/kern/parse.c: Converted to the basic type typedefs, added the identifier abstract syntax, and fleshed out all the rest of the expression abstract syntax. Since I started at the bottom chunks of the tree instead of the top, it's hard to say whether or not any of this works. Guess I can just test the entire abstract syntax tree all at once. [17e93990a284] * TODO: Same as always. [4d42bcfa10a4] * src/include/basic_types.h, src/include/tokens.h, src/kern/tokenize.c: Just in case we ever have to change the definitions of the basic mitchell types, here they are in one convenient place. [25aeafb310dd] * src/include/memory.h, src/kern/tokenize.c: Use a header file for those common memory management macros. [0a126b19d282] * src/include/absyn.h, src/kern/parse.c: This is the beginnings of the abstract syntax tree creation - added types for expression subtrees (pretty nasty) and changed function return values in the parser to return these subtree types. Of course, all they return right now is NULL but it's the right type of NULL. [508cfec85504] * Makefile: We don't always want to nuke the tags file, since that's a helpful thing to have around. [0fa0befbb4cd] * src/kern/Makefile, src/kern/main.c, src/kern/parse.c, src/kern/tokenize.c: Use Hans Boehm's garbage collection library instead of having to worry about managing all this memory myself. Last time I checked, it was 2004 and the computer can do things for us. [a6a1842ff001] * README, TODO: Added more stuff to the TODO list and outline the build requirements. [963aa5394c3d] * docs/mitchell.1: Explain the importance of LANG and LC_ALL. [470e8d2542bb] 2006-06-23 chris * .hgtags: Added tag PREVIEW_1 for changeset aae5cb42041224ce701a196ac562d0f595eeb9b1 [881e7faf1447] 2004-10-21 chris * README: Modified the guarantee explanation. [aae5cb420412] [PREVIEW_1] 2004-10-20 chris * src/kern/main.c, src/kern/parse.c: I just remembered how much I hate cpp, so use enums instead of preprocessor defines. [dfee056ed62a] * src/include/tokens.h: I just remembered how much I have cpp, so use enums instead of preprocessor defines. [d64d1f0f6ec6] * docs/mitchell.1: Cleaned up the man page a little bit. [70b5b8e1a98e] * README: Added licensing information to the README. [d9840f79fb54] * Makefile, src/kern/Makefile: Created a top-level makefile so people don't have to go hunting. This also includes the test targets. [f81a8108a685] * README: Have some more documentation, like it really matters. Also, it's hard to write about a project that only has syntax and no semantics. [4e0a90a8d7f3] * docs/mitchell.1: Added a man page that appears to be actually helpful. If I keep this up, I can just refer people to this instead of coming up with 47 other documentation files that people ignore. [19baf42c1ffe] 2004-10-19 chris * tests/fib-001.mitchell, tests/fib-002.mitchell, tests/gcd-001.mitchell: More actual programs to test with. These actually compute things and should be a good test of the function call code when we get to running the compiled program. [494fc85605f0] * TODO: Updated TODO list. Too bad most everything that needs to be done involves writing documentation. [95bb4c08eefb] * docs/grammar: Made sure the grammar document matches the actual parser and tokenizer. [b381a9020f54] * tests/fact-001.mitchell: Added the recursive factorial program. Time for some actual programs while will show more complex usage and turn up bugs. [cdc6ac5dc420] * tests/case-001.mitchell, tests/case-002.mitchell, tests/if-003.mitchell, tests/if-004.mitchell: Whoops, case-001 and case-002 were the same thing. Also, changed Base to Integer and Bool to Boolean. I know it's way too early for that, but might as well correct it while it's on my mind. [e5ee0c3e6266] * tests/case-001.mitchell, tests/case-002.mitchell, tests/case-003.mitchell, tests/case-004.mitchell: Added some test cases for the case expression. [dd3192937e3e] * src/kern/parse.c: Only spew output from the parser if the debugging options are set appropriately. [d6bd5d901771] * tests/if-001.mitchell, tests/if-002.mitchell, tests/if-003.mitchell, tests/if-004.mitchell, tests/if-005.mitchell, tests/if-006.mitchell, tests/if-007.mitchell: Added a bunch of if-then-else tests, some of which test some pretty crazy expressions. These ought to be interesting when it comes time for static analysis and backend stuff. [9fd8e3d43ae9] 2004-10-18 chris * src/include/config.h, src/kern/main.c: Added much better command line argument processing through getopt and a compiler control structure that holds all the runtime settings. The basis of the debugging framework is also in place with the -Idebug-parser command line option, though this option does not currently do anything. [26a4abf910f6] * src/kern/Makefile: A little optimization never hurt anyone (probably). [90df6067fb33] * TODO: Removed items from TODO list that have been done. [1c0859262aba] * src/kern/.cvsignore: No more seeing files I don't care about. [a50b9a005580] * src/kern/Makefile: Added a target to run all the tests automatically and print a summary. [0b9b1e89e590] * src/kern/parse.c: Calculated first and follow sets for all nonterminals and encoded those sets as some big two-dimensional arrays. Then, I'm using those sets to aid in parsing which fixes problems like empty decl- lsts and expr-lsts. There's probably more places that could benefit from using these sets, and I'll take care of those as more test cases are written. [ce1202907a11] 2004-10-17 chris * tests/const-001.mitchell, tests/const-002.mitchell, tests/const-003.mitchell, tests/const-004.mitchell, tests/const-005.mitchell: Added tests for parsing of constants. [bf7805236053] * tests/type-005.mitchell, tests/type-006.mitchell: Added a few more type tests for dealing with mangled records. [67bbcf0d03f7] * tests/type-001.mitchell, tests/type-002.mitchell, tests/type-003.mitchell, tests/type-004.mitchell: Added parse tests for types. More to follow, probably. [7994d8298aed] * docs/grammar, src/kern/parse.c: Removed the option for having a bracketed list of identifiers in a type, since that was a holdover of wanting to use the same syntax for record and lists. That's no longer allowed, so remove this too. [a82f8f5d1112] * docs/grammar, src/kern/parse.c: Corrected parser to allow functions to have empty argument lists. See tests/module-002.mitchell. [0747aaf73676] * tests/function-001.mitchell, tests/function-002.mitchell, tests/function-003.mitchell, tests/function-004.mitchell, tests/function-005.mitchell, tests/function-006.mitchell, tests/function-007.mitchell: Added a bunch of parser tests for functions. [765e63839a94] * tests/module-001.mitchell, tests/module-002.mitchell: Added the beginnings of a test suite. I expect to have tons of these things before too much longer. [468f2053a4d7] * editing/mitchell-vimrc: Added help for editing mitchell source code files in vim. [6b752106324e] 2004-10-16 chris * src/kern/parse.c: Better error reporting (there will probably be lots of commit messages with that phrase) and added the brace recognition for records that I thought I'd added before. [bfe9a86049ac] * src/kern/tokenize.c: Put line counting in read_char so we also handle updating the line numbers in a multi-line string. [52cfe9af59f6] 2004-10-15 chris * TODO: Every project needs a TODO list that never gets finished. [39c1795bf75a] * src/include/parse.h, src/kern/main.c: Whoops, I really wanted to have a header file for the parser to avoid externing functions all over the place. [fbfb522894d9] * src/include/tokens.h, src/kern/Makefile, src/kern/main.c, src/kern/parse.c, src/kern/tokenize.c: Added a target to make tagfiles, and automatically include the tagfiles when vim is started on each file. [4cffa365c1fd] * src/kern/Makefile, src/kern/main.c, src/kern/parse.c: Added a full recursive descent parser that recognizes the mitchell grammar, though I have not yet done a full test suite for all the syntax bits. That should be coming shortly. While I hate making the first commit on something be it in a mostly completed state, there's really not a good halfway point to commit the parser. It's all so simple and mutually recursive that this is the easiest way to do it. [5621c89e27fe] * src/kern/tokenize.c: Added the token map array for error reporting and also recognize braces which the grammar now requires to understand a record declaration. [baa33458fe62] * src/include/tokens.h: Changed the values tokens map to. I'm using an array of strings to map a token to a string, therefore making error reporting output a little more useful. So, the tokens need values more condusive to being indices. [89fe06ded6c6] * docs/grammar: Fixed grammar problems that were making it difficult to work on the parser. In particular: the difference between an expr-lst and a record-assn-lst was causing problems that I'd need a stack to solve which isn't going to happen, and there was also an ambiguity between function calls and identifiers in expr that was solved by adding more productions. [de9b18f90b58] 2004-10-13 chris * src/include/tokens.h, src/kern/main.c, src/kern/tokenize.c: Added all the reserved characters and words from the grammar into the tokenizer and also into the main file for testing purposes. The main file is actually about to get destroyed in favor of a parser. Also, added line numbers into each token for error reporting. [eae53651cc49] * src/include/tokens.h, src/kern/main.c, src/kern/tokenize.c: Added support for booleans. This is the last commit before reworking major chunks of the tokenizer to conform to the grammar. [ee69551e1983] * docs/grammar: Added the grammar, so now we know what we're trying to recognize. Hooray. [d4c69ebf8b2a] 2004-09-02 chris * src/kern/tokenize.c: Let's at least try to spell the name of the program right. [01a96fb19704] 2004-09-01 chris * src/include/tokens.h, src/kern/main.c, src/kern/tokenize.c: Added reserved function character. [97122bbfae50] * src/kern/Makefile: Link in everything, not just what's changed. [6ceb711e312c] 2004-08-31 chris * COPYING, src/include/tokens.h, src/kern/main.c, src/kern/tokenize.c: Added licensing to the top of the source files and fleshed out the comments a bit more. [9a76afd203f1] 2006-06-23 chris * .hgtags: Added tag INIT for changeset 8c2509ef5e6503a5785987c76797c895201795b4 [428380c07088] 2004-08-31 chris * .hgignore, src/include/tokens.h, src/kern/Makefile, src/kern/main.c, src/kern/tokenize.c: Initial revision [8c2509ef5e65] [INIT]