Marijn Haverbeke
6ed8d03784
Make sure iface_methods are set before they are accessed
...
Closes #1761
2012-02-06 09:56:42 +01:00
Ian D. Bollinger
d1158ca333
Removed sendfn from badwords and made the precedence of XOR between that of OR and AND.
2012-02-06 09:56:41 +01:00
Marijn Haverbeke
e0fa5cd2ed
Self types for ifaces
...
This allows a 'Name:' to appear in front of an iface declaration's
name, which will cause 'Name' to refer to the self type (with the same
number of type parameters as the iface has) in the method signatures
of the iface. For example:
iface F: functor<A> {
fn fmap<B>(f: fn(A) -> B) -> F<B>;
}
Issue #1718
2012-02-06 09:56:41 +01:00
Marijn Haverbeke
5c42e3df9c
Allow non-semicolon-requiring expressions to be followed by .field
...
There is no valid expression that starts with a dot token (.5 is a number token),
so this introduces no ambiguities.
Issue #1716
2012-02-06 09:13:32 +01:00
Kevin Atkinson
b7ec2488ff
Fix macro backtraces.
...
In addition add information about the macro doing the expansion, and
move the printing of the expansion backtrace from codemap::span_to_str
to the diagnostic code. The backtrace is now more verbose and
includes information on the macro doing the expansion, in addition to
the expansion site.
2012-02-05 15:38:27 -08:00
Kevin Atkinson
1d855ebc51
Remove support for $(...) form of quasi-quotes, use #ast{...} instead.
2012-02-05 15:38:27 -08:00
Brian Anderson
91b6dc5c8e
Merge remote-tracking branch 'erickt/master'
...
Conflicts:
src/libcore/vec.rs
src/libstd/getopts.rs
2012-02-05 15:15:21 -08:00
Niko Matsakis
966504c828
don't fail if inference is not complete
2012-02-05 10:06:27 -08:00
Niko Matsakis
7f12358656
resolve some merge failures
2012-02-05 09:56:10 -08:00
Niko Matsakis
77b06d24cd
infer modes rather than overwriting with expected ty
2012-02-05 09:12:44 -08:00
Tim Chevalier
f3343b3571
Beginnings of front-end support for classes
...
Added class support to the parser, prettyprinter, fold, and visit.
(See Issue 1726.)
This is WIP -- the test case is xfailed, and attempting to compile
it will error out in resolve.
2012-02-03 22:47:35 -08:00
Ted Horst
d65eabd5de
log to stderr instead of stdout
...
includes rustc diagnostics
runtest updated to check stderr for errors
2012-02-03 20:55:53 -08:00
Graydon Hoare
8fc624bc08
Fix various drift issues in the qq branch.
2012-02-03 20:54:18 -07:00
Kevin Atkinson
3604f36938
Implement folding of ast::ty.
2012-02-03 20:54:17 -07:00
Kevin Atkinson
5f6a1159bb
Fix q-q so that non-expression q-q actually work when there is embed anti-q.
2012-02-03 20:54:00 -07:00
Kevin Atkinson
a2dde9a692
Allow anti-quotes to also be ast::ty rather than just ast::expr.
2012-02-03 20:41:49 -07:00
Kevin Atkinson
6dcd12dc22
Implement quasi-quoting of multiple syntatic categories.
2012-02-03 20:41:49 -07:00
Kevin Atkinson
35a199c036
Formatting cleanups.
2012-02-03 20:41:49 -07:00
Kevin Atkinson
9090a5c03b
Store info about file "substr".
...
That is when a string that is part of a file needs to be parsed for a
reason, record that the string is a substr of the file rather than
using "<anon>" or "-" as the file name. This will eventually allow
pointing to the right location, for now it just uses a more
meaningful string for the filename.
2012-02-03 20:41:49 -07:00
Kevin Atkinson
4d71285c93
Implement quasi-quotes in more macro form: #ast{...}.
...
The #(...) form is still supported for now.
2012-02-03 20:41:49 -07:00
Kevin Atkinson
1c91fb4d91
Don't rely on filename to get a file from the filemap
...
as there may be more than one filemap with the same filename (in the
case of stdin for instance). This involved storing a pointer to the
filemap rather than the filename in location info such as
codemap::pos.
2012-02-03 20:41:49 -07:00
Kevin Atkinson
4616117f17
Bug fix in lookup_byte_offset.
2012-02-03 20:41:49 -07:00
Kevin Atkinson
da74a7f9ca
Make macro arg optional in syntax, again untested.
2012-02-03 20:41:48 -07:00
Kevin Atkinson
5ea04c65c1
Add support for recognizing macro body, completely untested.
2012-02-03 20:41:48 -07:00
Kevin Atkinson
e76fdeb3a6
Change the type for the macro body to also store the span.
...
Note: the body is the part of the macro syntax between the {}.
2012-02-03 20:41:48 -07:00
Kevin Atkinson
099290bc73
When replacing $(...) with $0 preserve spacing for better error messages.
...
That is:
x + $(foo) + y
becomes:
x + $0 + y
not:
x + $0 + y
2012-02-03 20:41:37 -07:00
Kevin Atkinson
c0f9073557
Expand result of quasi-quote.
2012-02-03 20:39:00 -07:00
Kevin Atkinson
67e961c17f
Implement anti-quotes.
2012-02-03 20:38:44 -07:00
Kevin Atkinson
477714f08e
Implement "replace" function.
2012-02-03 20:28:12 -07:00
Kevin Atkinson
485e489ba2
Implement basic quasi-quoter. No anti-quotes yet.
2012-02-03 20:28:11 -07:00
Kevin Atkinson
98450d0dad
Rename AST builders to use uniform naming scheme. Also add a few more.
2012-02-03 20:28:11 -07:00
Kevin Atkinson
5ef53382ae
Add support for parsing quasi-quotes, doesn't do anything useful yet.
2012-02-03 20:23:49 -07:00
Kevin Atkinson
75edd9ff69
Move useful ast building functions into their own module.
2012-02-03 17:48:17 -08:00
Kevin Atkinson
9dcb674525
Add function to get a code snippet from a span,
...
and also to get the byte offset within a string from a span chpos.
2012-02-03 17:48:17 -08:00
Marijn Haverbeke
61367e3c27
Fix prefixing of logging paths with crate name
2012-02-03 22:12:09 +01:00
Tom Lee
31b0d1b4bd
core: rename str::lteq to str::le
2012-02-03 14:09:44 +01:00
Marijn Haverbeke
633e4502e7
Clean up and update trans::ty_ctxt type definition
...
It had been messed up by the pretty-printer at some point, and was
partially out of date.
2012-02-03 14:09:16 +01:00
Marijn Haverbeke
3bcd4fe6fa
Start on in-crate monomorphizing
...
Adds a --monomorpize flag to rustc to turn it on. You probably don't
want to use it yet, since it's broken in a whole bunch of ways, but it
successfully monomorphizes simple generic functions called from within
the crate.
Issue #1736
2012-02-03 14:07:35 +01:00
Marijn Haverbeke
43ce38375d
Store item paths in ast_map, get rid of trans::local_ctxt
...
The direct motivation for this was that the monomorphizer needs to be
able to generate sane symbols for random items. The typechecker can
probably also use this in the future to provide more useful error
messages.
2012-02-03 11:34:12 +01:00
Marijn Haverbeke
c1b075d042
Remove experimental GC code
...
It's been sitting unused long enough to have bitrotted completely.
2012-02-03 11:34:12 +01:00
Marijn Haverbeke
743c62e1ce
Fix assumption in mut.rs that op overloading breaks
...
Closes #1733
2012-02-02 08:11:20 +01:00
Brian Anderson
2b67de06c8
rustdoc: Add support for type items
2012-02-01 22:41:54 -08:00
Kevin Cantu
8f367ebfeb
Rename (again) str::unsafe::slice -> str::unsafe::slice_bytes and
...
str::unsafe::safe_slice -> str::unsafe::slice_bytes_safe_range
2012-02-01 21:56:53 -08:00
Kevin Cantu
fceec03da0
Propagating unsafe::slice 3
2012-02-01 21:56:53 -08:00
Kevin Cantu
6156bc56cb
Propagating unsafe::slice 2
2012-02-01 21:56:53 -08:00
Niko Matsakis
196d69beb2
make boxes self-describing ( fixes #1493 )" (take 2)
...
this will be used to generate a new snapshot.
2012-02-01 18:52:08 -08:00
Niko Matsakis
3116643806
Revert "make boxes self-describing ( fixes #1493 )" until a new
...
snapshot is prepared.
2012-02-01 18:50:19 -08:00
Niko Matsakis
c36207bfb8
make boxes self-describing ( fixes #1493 )
2012-02-01 18:18:07 -08:00
Marijn Haverbeke
2dbaa05af8
Remove support for native types
...
Issue #1673
2012-02-01 12:23:13 +01:00
Marijn Haverbeke
c6aead7281
Get rid of native types in LLVM module
...
Code is still somewhat kludgy because we don't have 32-bit enums.
Issue #1673
2012-02-01 12:23:13 +01:00