Commit graph

7826 commits

Author SHA1 Message Date
Marijn Haverbeke
6bead0e4cc Use operator names for operator methods
The methods used to implement operators now simply use
the name of the operator itself, except for unary -, which is called
min to not clash with binary -. Index is called [].

Closes #1520
2012-01-26 15:52:28 +01:00
Marijn Haverbeke
3aed4b04ce [makefiles] Make rustc depend on librustc
This ensures the lib is not just built, but also copied into the right
lib directory when a rustc binary is used as make target.
2012-01-26 15:43:39 +01:00
Marijn Haverbeke
305b1c8701 Fix small bug in iface self types
Issue #1661
2012-01-26 15:24:52 +01:00
Marijn Haverbeke
888262b337 Allow operator overloading of the indexing operator
The method `op_index` (which takes a single argument) is used for
this.

Issue #1520
2012-01-26 15:23:11 +01:00
Marijn Haverbeke
87b064b249 First stab at operator overloading
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-26 14:25:06 +01:00
Marijn Haverbeke
1792d9ec96 Use string stored in codemap for pretty-printing comments and literals
Closes #1665
2012-01-26 10:52:08 +01:00
Marijn Haverbeke
ec4d05de3b Remove ty_native_fn
It was being used as a clumsy synonym of ty_fn.
2012-01-26 10:37:50 +01:00
Kevin Cantu
3afc16f7a4 Change FIXME comments in str 2012-01-25 23:20:10 -08:00
Kevin Cantu
4d7c297bea (FIX) Change encoder::encode_metadata to return a [u8] (which will become an LLVM string) 2012-01-25 22:27:29 -08:00
Kevin Cantu
5847cf0367 (TEMPORARY) Break something by making io::mem_buffer_str UTF-8 safe 2012-01-25 21:53:37 -08:00
Brian Anderson
566a4be1f8 rustdoc: Add some test enums to demo module 2012-01-25 21:04:53 -08:00
Brian Anderson
74e8b11194 rustdoc: Write markdown for enums 2012-01-25 21:04:53 -08:00
Brian Anderson
d6ce20973a rustdoc: Apply general string ops to enum docs 2012-01-25 21:04:53 -08:00
Brian Anderson
53c6454de5 rustdoc: Extract brief enum descs from long descs 2012-01-25 21:04:53 -08:00
Brian Anderson
1d94f40c6c rustdoc: Prune undocumented enums 2012-01-25 21:04:53 -08:00
Brian Anderson
95a006ce52 rustdoc: Add enum doc attributes to the doc tree 2012-01-25 21:04:53 -08:00
Brian Anderson
a25bc195e2 rustdoc: Parse variant doc attributes 2012-01-25 21:04:53 -08:00
Brian Anderson
87c3a5c1a3 rustdoc: Extract some common functions from attr_parser 2012-01-25 21:04:52 -08:00
Brian Anderson
259ea4e4b4 rustdoc: Parse enum doc attributes 2012-01-25 21:04:52 -08:00
Brian Anderson
5166cc29e9 rustdoc: Fix a copy&paste bug in attr_parser tests 2012-01-25 21:04:52 -08:00
Brian Anderson
0b9f2a8215 rustdoc: Extract variant signatures 2012-01-25 21:04:49 -08:00
Brian Anderson
b7b8455e54 rustc: Add pprust::variant_to_str 2012-01-25 17:22:08 -08:00
Brian Anderson
1586cce0ea rustdoc: Add enum folding 2012-01-25 16:56:28 -08:00
Brian Anderson
e946792a78 rustdoc: Extract enum doc nodes from AST nodes 2012-01-25 16:50:32 -08:00
Brian Anderson
2999479a2d rustc: Allow attributes on enum variants. Closes #1663 2012-01-25 16:24:06 -08:00
unknown
fe57a7e582 Add Inno Setup installer script rather than NSIS 2012-01-25 16:02:53 -08:00
Brian Anderson
08c6cb5f70 Merge pull request #1664 from kevina/issue-1612
See Issue #1612
2012-01-25 15:22:10 -08:00
Kevin Atkinson
60a146bf0f Correctly increment sess.byte_pos. 2012-01-25 16:01:58 -07:00
Kevin Atkinson
c5e03e0e59 Keep source file around after parsing.
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-25 16:00:47 -07:00
Brian Anderson
ab223e0618 Merge pull request #1627 from graydon/win32-quoting
Fix win32 command-line quoting on rust_run_program.
2012-01-25 14:33:10 -08:00
Tim Chevalier
746fa27988 In the tutorial install directions, mention that you may need to sudo make install 2012-01-25 13:49:32 -08:00
Brian Anderson
4168101b03 test: Un-xfail run-pass/tag-auto-disr-val-shape 2012-01-25 12:44:13 -08:00
Brian Anderson
19a9a475a6 test: Add regression test for #1659 2012-01-25 12:40:08 -08:00
Brian Anderson
ba7299ba65 test: Un-xfail run-pass/tag-disr-val-shape
Fixed by 96f1eda6d0
2012-01-25 12:34:37 -08:00
Marijn Haverbeke
2d4d8e8bdb Implement implicit self type parameters for ifaces
Closes #1661
2012-01-25 20:47:11 +01:00
Marijn Haverbeke
76aabbe99d Rename tag to enum throughout the compiler
This should reduce confusion of people trying to read the code.
2012-01-25 14:34:31 +01:00
Marijn Haverbeke
8420f8c52e Repair zero-variant tags
The parser no longer parsed them.
2012-01-25 14:10:33 +01:00
Marijn Haverbeke
2f0f6c782a Add bit-shifting ops to ast_util::eval_const_expr
Closes #1659
2012-01-25 13:19:32 +01:00
Kevin Cantu
fec36de94e Making str::from_cstr UTF-8 safe 2012-01-25 02:25:57 -08:00
Kevin Cantu
a185b10647 Replacing str::unsafe_from_bytes with str::from_bytes (part 6) 2012-01-25 01:42:28 -08:00
Kevin Cantu
57717fa4d8 Replacing str::unsafe_from_bytes with str::from_bytes (part 5) 2012-01-25 01:29:44 -08:00
Kevin Cantu
87320a9f27 Replacing str::unsafe_from_bytes with str::from_bytes (part 4) 2012-01-25 01:20:55 -08:00
Joe Pletcher
edd86126f7 Added a small note to help explain tag's in older code. 2012-01-25 10:17:50 +01:00
Joe Pletcher
b02b65a547 Remove stale references to tags, replaced with enums. 2012-01-25 10:17:49 +01:00
Marijn Haverbeke
8ae4868419 Add Joe Pletcher to AUTHORS.txt 2012-01-25 10:17:12 +01:00
Joe Pletcher
3b9a9fce49 Remove reference to tags, replace enums. 2012-01-25 10:16:32 +01:00
Kevin Cantu
eaa4befd6d Replacing str::unsafe_from_bytes with str::from_bytes (part 3) 2012-01-25 01:07:05 -08:00
Kevin Cantu
64ce563c05 Replacing str::unsafe_from_bytes with str::from_bytes (part 2) 2012-01-25 01:00:21 -08:00
Kevin Cantu
c7b23f9a86 Replacing str::unsafe_from_bytes with str::from_bytes (part 1) 2012-01-25 00:53:17 -08:00
Kevin Cantu
9750e83a17 Replace uses of str::unsafe_from_byte 2012-01-24 23:47:32 -08:00