about summary refs log tree commit diff
path: root/src/comp
AgeCommit message (Collapse)AuthorLines
2012-01-26First stab at operator overloadingMarijn Haverbeke-141/+251
When no built-in interpretation is found for one of the operators mentioned below, the typechecker will try to turn it into a method call with the name written next to it. For binary operators, the method will be called on the LHS with the RHS as only parameter. Binary: + op_add - op_sub * op_mul / op_div % op_rem & op_and | op_or ^ op_xor << op_shift_left >> op_shift_right >>> op_ashift_right Unary: - op_neg ! op_not Overloading of the indexing ([]) operator isn't finished yet. Issue #1520
2012-01-26Use string stored in codemap for pretty-printing comments and literalsMarijn Haverbeke-35/+23
Closes #1665
2012-01-26Remove ty_native_fnMarijn Haverbeke-128/+38
It was being used as a clumsy synonym of ty_fn.
2012-01-25(FIX) Change encoder::encode_metadata to return a [u8] (which will become an ↵Kevin Cantu-3/+3
LLVM string)
2012-01-25rustc: Add pprust::variant_to_strBrian Anderson-17/+39
2012-01-25rustc: Allow attributes on enum variants. Closes #1663Brian Anderson-4/+16
2012-01-25Correctly increment sess.byte_pos.Kevin Atkinson-6/+6
2012-01-25Keep source file around after parsing.Kevin Atkinson-42/+36
Specifically box the string (to avoid unnecessary copies) and store it in codemap::filemap. Remove the hack in driver::diagnostic that rereads the source from the file and instead just get the source from the filemap. (This commit is also a prerequisite for issue #1612)
2012-01-25Implement implicit self type parameters for ifacesMarijn Haverbeke-72/+100
Closes #1661
2012-01-25Rename tag to enum throughout the compilerMarijn Haverbeke-329/+314
This should reduce confusion of people trying to read the code.
2012-01-25Repair zero-variant tagsMarijn Haverbeke-51/+24
The parser no longer parsed them.
2012-01-25Add bit-shifting ops to ast_util::eval_const_exprMarijn Haverbeke-0/+4
Closes #1659
2012-01-25Replacing str::unsafe_from_bytes with str::from_bytes (part 4)Kevin Cantu-12/+12
2012-01-25Replacing str::unsafe_from_bytes with str::from_bytes (part 3)Kevin Cantu-2/+2
2012-01-24Replace uses of str::unsafe_from_byteKevin Cantu-2/+2
2012-01-24rustc: Bump the error count on non-span errorsBrian Anderson-0/+1
2012-01-24rustc: Split diagnostics into "span diagnostics" and "diagnostics".Patrick Walton-73/+102
The former contain a codemap (which is per-crate), and the latter don't. This will be useful in order to allow more than one crate to be compiled in one run of the compiler.
2012-01-24comp: Fix syntax error in parserBrian Anderson-1/+1
2012-01-24Merge pull request #1631 from j-clark/patch-2Brian Anderson-2/+3
Added to bad_expr_word_table reserved words
2012-01-23Add export{} syntax to encapsulate things that should be abstractTim Chevalier-1/+1
2012-01-23Added to bad_expr_word_table reserved wordsJoshua Clark-2/+3
2012-01-23s/block()/fn()/gNiko Matsakis-47/+40
2012-01-23When replacing a pattern variable in macro expansion use the span ofKevin Atkinson-6/+6
the replacement and not the span of the pattern variable. Fixes issue #1448, and #1387.
2012-01-23Allow ast_fold_precursor to change the span.Kevin Atkinson-81/+111
This involved changing the prototype for the callbacks to thread the span though. A wrapper function, fold::wrap, can be used to wrap the old style callbacks.
2012-01-23Don't reset the chpos/byte_pos to 0 in new_parser_from_source_str.Kevin Atkinson-21/+32
This correctly fixes issue #1362. chpos/byte_pos are now the offsets within a particular file, but rather the offsets within a virtual file with is formed by combing all of the modules within a crate. Thus, resetting them to 0 causes an overlap and hence, bogus source locations. Fix #1362 by moving chpos/byte_pos to parse_sess so that new_parser_from_source_str has access to them and hence can chose an initial value that is not already been used in the crate. Note that the trigger for bug 1361 was that syntax/ext/expand.rs calls parse_expr_from_source_str (which calls new_parser_from_source_str) using the same codemap as the current crate (and hence causing overlap with files in the crate as new_parser_from_source_str resets the chpos/byte_pos to 0).
2012-01-23Change "file" of injected string from "-" to "<anon>", less confusingKevin Atkinson-1/+1
that way.
2012-01-23Revert "rustc: Exclude stdin from codemap files when lookup_pos".Kevin Atkinson-5/+3
Need a better fix, right now it is just causing even more confusion, for example in issue #1448 and #1387. This reverts commit 1e4de333740690357a8f58883c5c69bf58be1424.
2012-01-23Change rustc and rustdoc's #[desc] attribute to #[comment]Brian Anderson-1/+1
There are two attributes in use for this same purpose.
2012-01-23Check that the names mentioned in tag exports are actually types (or variants)Tim Chevalier-2/+58
Check that in export foo{}, foo is an enum type, and that in export foo{bar, quux}, foo is an enum type and bar and quux are variants belonging to foo.
2012-01-23Export all enum variants by default; new syntax for selectively exporting ↵Tim Chevalier-14/+53
variants See issue 1426 for details. Now, the semantics of "export t;" where t is a tag are to export all of t's variants as well. "export t{};" exports t but not its variants, while "export t{a, b, c};" exports only variants a, b, c of t. To do: - documentation - there's currently no checking that a, b, c are actually variants of t in the above example - there's also no checking that t is an enum type, in the second two examples above - change the modules listed in issue 1426 that should have the old export semantics to use the t{} syntax I deleted the test export-no-tag-variants since we're doing the opposite now, and other tests cover the same behavior.
2012-01-21wrap lineNiko Matsakis-1/+2
2012-01-21unify size_of, align_of into one call (metrics)Niko Matsakis-104/+346
create some new (xfail'd) tests looking at tag variant alignment
2012-01-21migrate size_of() and related funcs from trans into shapeNiko Matsakis-263/+268
2012-01-21issue #1352: change param order on vec::init_elt, putting block in final ↵Graham Fawcett-25/+25
position. To match the init_fn() and init_fn_mut() changes.
2012-01-21fix #1352: change param order on vec::init_fn (and vec::init_fn_mut), ↵Graham Fawcett-4/+4
putting block in final position.
2012-01-22rustc: Specify lint checks via crate attributesHaitao Li-13/+101
A crate attribute like `#[lint(no_ctypes)]` can now be used to turn off ctypes checking. Issue #1543
2012-01-21rustc: Always resolve reexported names from original defHaitao Li-33/+64
Issue #1501
2012-01-20WIP on issue 1426 (exporting all tags)Tim Chevalier-4/+32
Support Lenny222's proposed syntax for exporting a tag without its variants, or selected tags from a variant, in the AST and parser. No support further down the line yet. Tests are xfailed.
2012-01-20Handle fail after return correctly in typestateTim Chevalier-4/+18
Previously, typestate would conclude that this function was correctly diverging: fn f() -> ! { ret; fail; } even though it always returns to the caller. It wasn't handling the i_diverge and i_return bits correctly in the fail case. Fixed it. Closes #897
2012-01-19Handle predicates that recurse in a check() expressionTim Chevalier-9/+10
typestate was using the enclosing function ID for the "this function returns" constraint, which meant confusion and panic in the case where a predicate p includes "check p()". Fixed it to use a fresh ID. Closes #933
2012-01-19Additional ; to , changes, disable "tag" and ";" in parser. Close #1430. ↵Graydon Hoare-6/+6
Close #1428.
2012-01-19rustc: Stop parsing "tag"Patrick Walton-2/+2
2012-01-19rustc: Make the pretty printer output commas after enum variants. Update all ↵Patrick Walton-1/+1
tests accordingly.
2012-01-19rustc: Fix fun_to_strBrian Anderson-0/+14
2012-01-19rustc: ";" to "," in enumsPatrick Walton-450/+450
2012-01-19rustc: Remove trailing whitespacePatrick Walton-1/+1
2012-01-19Compute typestates for FRU exprs correctly, plus a bit of cleanupTim Chevalier-50/+36
The code in Issue 948 was causing typestate to diverge because it was using the prestate for the whole expression -- not the post- state for the fields list -- as the prestate for the record base expression. Fixed. Closes #948
2012-01-19Handle log expressions with a _|_-typed levelTim Chevalier-0/+6
If we have log(foo, quux) where foo:_|_, just translate foo and ignore the rest of the expression. Closes #1459
2012-01-19rustc: Fix long linesPatrick Walton-5/+6
2012-01-19rustc: "tag" -> "enum"Patrick Walton-183/+183