about summary refs log tree commit diff
path: root/src/comp/front/lexer.rs
AgeCommit message (Collapse)AuthorLines
2011-07-05Move everything syntax-related to syntax/, break deps on rest of compilerMarijn Haverbeke-739/+0
src/comp/syntax is currently just a sub-module of rustc, but it will, in the near future, be its own crate. This includes: - The AST data structure - The parser - The pretty-printer - Visit, walk, and fold - The syntax extension system - Some utility stuff that should be in the stdlib* *) Stdlib extensions currently require a snapshot before they can be used, and the win build is very broken right now. This is temporary and will be cleaned up when one of those problems goes away. A lot of code was moved by this patch, mostly towards a more organized layout. Some package paths did get longer, and I guess the new layout will take some getting used to. Sorry about that! Please try not to re-introduce any dependencies in syntax/ on any of the other src/comp/ subdirs.
2011-06-30Preserve hard \n\n pairs from source when pretty-printing, as explicit ↵Graydon Hoare-4/+20
formatting control from users.
2011-06-30Kill unused variablesTim Chevalier-1/+0
2011-06-24Remove uses of variable name 'res' from rustcMarijn Haverbeke-7/+7
This in preparation of making 'res' a keyword for defining resources. Please don't introduce too many new ones in the meantime...
2011-06-19rustc: Rename session.span_err -> span_fatal, err -> fatalBrian Anderson-1/+1
Issue #440
2011-06-19Revert previous 6 commits. Hopefully put out Windows fire.Brian Anderson-1/+1
Revert "rustc: Export only what's needed from middle::ty" This reverts commit 4255d58aa5db2a05362c4435a0e807205e1b8ed7. Revert "rustc: Make name resolution errors less fatal" This reverts commit b8ab9ea89c16c60237e7660804f4321f59ae0435. Revert "rustc: Make import resolution errors less fatal" This reverts commit 92a8ae94b971206bf0502da3dc5f416fcb24cc36. Revert "rustc: Export only what's used from middle::resolve" This reverts commit 4539a2cf7ad99851a165c98ed2f4e4a475cffd7d. Revert "rustc: Re-introduce session.span_err, session.err" This reverts commit 7fe9a88e31ae07f2fd89f6715efedd7e3edf49e6. Revert "rustc: Rename session.span_err -> span_fatal, err -> fatal" This reverts commit c394a7f49ac29a099994e243017065de2ff97f2a.
2011-06-19rustc: Rename session.span_err -> span_fatal, err -> fatalBrian Anderson-1/+1
Issue #440
2011-06-16Reformat a bunch of recent churn.Graydon Hoare-1/+1
2011-06-16Add "<->" to the token definition and the lexer.Michael Sullivan-1/+7
2011-06-15Reformat source tree (minus a couple tests that are still grumpy).Graydon Hoare-379/+169
2011-06-14Fix bug in detecting trailing comments when at beginning-of-file.Graydon Hoare-1/+3
2011-06-09Further support for predicate constraintsTim Chevalier-27/+1
Changed function types to include a list of constraints. Added code for parsing and pretty-printing constraints. This necessitated splitting pprust into two files (pprust and ppaux) to break a circulate dependency, as ty_to_str now needs to print out constraints, which may include literals, but pprust depended on ty.
2011-06-07Add multiline, whitespace-eating strings.Josh Matthews-0/+3
2011-06-02Pretty-print literals exactly as we saw them in the source.Graydon Hoare-5/+29
2011-05-31Fix comment-scanning logic in lexer.Graydon Hoare-2/+4
2011-05-31Improve comment handling in pp.Graydon Hoare-57/+162
2011-05-31rustc: Remove unneeded type params from alt patternsBrian Anderson-4/+4
2011-05-27Fix missing bump in RECV lexer case.Michael Sullivan-0/+1
2011-05-27Lex '|>' as the RECV token.Michael Sullivan-6/+13
2011-05-23Get test-pass/utf8.rs to runMarijn Haverbeke-43/+23
This involved a small fix to the unicode-escape character lexing and to the pretty-printer.
2011-05-20rustc: Move the interner to a new module intended to be used for general ↵Patrick Walton-2/+2
data structures
2011-05-17Alias-ify the parser and lexerMarijn Haverbeke-12/+12
This only shaves a measly 19k off the rustc binary... but hey, every little thing helps.
2011-05-17Finally rename std::_xxx to std::xxxMarijn Haverbeke-30/+30
Except for _task, which is still a keyword.
2011-05-16Rewrite everything to use [] instead of vec() in value position.Graydon Hoare-6/+6
2011-05-16rustc: Make the parser use the internerPatrick Walton-21/+21
2011-05-14Mark IDENT tokens that are followed by ::Marijn Haverbeke-1/+2
So that the type parser won't go off and try to parse a vec type when it sees vec::init_op.
2011-05-13Make the parser more careful about keywordsMarijn Haverbeke-146/+1
Keywords are now only recognized in contexts where they are valid. The lexer no longer recognizes them, all words are lexed as IDENT tokens, that get interpreted by the parser.
2011-05-12Downcase std modules again, move to :: for module dereferencingMarijn Haverbeke-198/+198
This should be a snapshot transition.
2011-05-12Change module dereference syntax from . to ::Marijn Haverbeke-2/+10
This will need to be a snapshot.
2011-05-12Properly lex block comments followed by EOFMarijn Haverbeke-4/+4
2011-05-11Remove unused filename parameter from lexer.new_readerBrian Anderson-2/+2
2011-05-11Give the lexer a session so that it can fail more informativelyBrian Anderson-18/+29
2011-05-09Remove boxes from token.t.Graydon Hoare-7/+20
2011-05-06Rename std modules to be camelcasedMarijn Haverbeke-40/+40
(Have fun mergining your stuff with this.)
2011-05-05Bring back "pred" syntax for writing predicates for checkTim Chevalier-0/+1
This commit reinstates the requirement that the predicate in a "check" must be a manifest call to a special kind of function declared with the new "pred" keyword instead of "fn". Preds must have a boolean return type and can only call other preds; they can't have any effects (as enforced by the typechecker). The arguments to a predicate in a check expression must be slot variables or literals.
2011-05-05Remove 'deprecated mutable...' from our codeMarijn Haverbeke-1/+1
This should make compilation a bit less noisy.
2011-05-02Un-revert "Use different syntax for checks that matter to typestate", fixing ↵Patrick Walton-1/+2
the problem. This reverts commit d08b443fffb1181d8d45ae5d061412f202dd4118.
2011-05-02Revert "Use different syntax for checks that matter to typestate"Graydon Hoare-2/+1
This reverts commit aa25f22f197682de3b18fc4c8ba068d1feda220f. It broke stage2, not sure why yet.
2011-05-02Use different syntax for checks that matter to typestateTim Chevalier-1/+2
This giant commit changes the syntax of Rust to use "assert" for "check" expressions that didn't mean anything to the typestate system, and continue using "check" for checks that are used as part of typestate checking. Most of the changes are just replacing "check" with "assert" in test cases and rustc.
2011-04-19Remove half-baked 'opacity' layer qualifier.Graydon Hoare-2/+0
2011-04-19Remove effect system from src.Graydon Hoare-19/+18
2011-04-19replace error logging with log_err in stdlib and rustcMarijn Haverbeke-14/+11
2011-04-19add log_err to rustcMarijn Haverbeke-0/+1
2011-04-13Lex numeric escapes, needed for lib-str.rs (which now passes).Graydon Hoare-13/+77
2011-04-09Move to single-uint file-position representation.Marijn Haverbeke-43/+38
This makes passing them around cheaper. There is now a table (see front/codemap.rs) that is needed to transform such an uint into an actual filename/line/col location. Also cleans up the span building in the parser a bit.
2011-04-09Make lexer buffer the whole fileMarijn Haverbeke-59/+66
This way, it won't have to go through a bunch of calls for each byte fetched.
2011-04-01Started adding support for typestate checking.Tim Chevalier-1/+1
I added a new field to the ast "ann" type for typestate information. Currently, the field contains a record of a precondition bit vector and postcondition vector, but I tried to structure things so as to make it easy to change the representation of the typestate annotation type. I also had to add annotations to some syntactic forms that didn't have them before (fail, ret, be...), with all the boilerplate changes that that would imply. The main call to the typestate_check entry point is commented out and the actual pre-postcondition algorithm only has a few cases implemented, though the overall AST traversal is there. The rest of the typestate algorithm isn't implemented yet.
2011-03-31handle unterminated block comments and line comment at eofMarijn Haverbeke-4/+9
2011-03-31Preserve comments when pretty-printing.Marijn Haverbeke-0/+80
The patch also includes a number of smaller fixes to the pretty-printer that were encountered on the way.
2011-03-29Beginnings of support for magical self prefix; nothing profound happening yet.Lindsey Kuper-0/+1