| Age | Commit message (Collapse) | Author | Lines |
|
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.
|
|
Just like it was done with items and exprs. Simplifies some code.
|
|
An expression like:
foo(1, fail, 2)
was failing to parse, because the parser was interpreting the comma
as the start of an expression that was an argument to fail, rather
than recognizing that the fail here has no arguments
Fixed this by using can_begin_expr to determine whether the next
token after a fail token suggests that this is a nullary fail or a
unary fail.
In addition, when translating calls, check before translating each
argument that the block still isn't terminated. This has the effect
that if an argument list includes fail, the back-end won't keep trying
to generate code for successive arguments and trip the !*terminated
assertion.
|
|
|
|
|
|
|
|
|
|
This is the old method of conditional compilation. It is going away.
Issue #489
|
|
Doing this:
tag foo = mytype;
is now equivalent to doing this:
tag foo { foo(mytype); }
|
|
|
|
crate_cfg will replace eval::env as the mechanism for conditional compilation.
This is a transitional step so they can both exist together.
Issue #489
|
|
This represents the compilation environment, defined as AST meta_items, Used
for driving conditional compilation and will eventually replace the
environment used by the parser for the current conditional compilation scheme.
Issue #489
|
|
The option can only be toggled at runtime now.
|
|
|
|
Implement "claim" (issue #14), which is a version of "check" that
doesn't really do the check at runtime. It's an unsafe feature.
The new flag --check-claims turns claims into checks automatically --
but it's off by default, so by default, the assertion in a claim
doesn't execute at runtime.
|
|
|
|
|
|
Resources are now defined like...
resource fd(int n) { close(n); }
Calling fd with an int will then produce a non-copyable value
that, when dropped, will call close on the given int.
|
|
|
|
be passed to the "linker". Use that for libc.
|
|
|
|
Non-copyability is not enforced yet, and something is still flaky with
dropping of the internal value, so don't actually use them yet. I'm
merging this in so that I don't have to keep merging against new
patches.
|
|
|
|
This in preparation of making 'res' a keyword for defining resources.
Please don't introduce too many new ones in the meantime...
|
|
|
|
The implementation is so simple it might be considered cheating: at almost
every step the expr_ternary is just converted to expr_if.
|
|
We decided to use metadata for the more complex cases, and a simple
string is enough for rustc right now.
|
|
|
|
Examples: #[test], #[link(name = "vers")]
Issue #487
|
|
|
|
|
|
|
|
|
|
into four separate issues (#538, #539, #540, #543) with corresponding
tests.
|
|
This simplifies the tag variants a bit and makes expr_node_id
obsolete.
|
|
This reduces some redundancy in the AST data structures and cruft in
the code that works with them. To get a def_id from a node_id, apply
ast::local_def, which adds the local crate_num to the given node_id.
Most code only deals with crate-local node_ids, and won't have to
create def_ids at all.
|
|
|
|
Issue #440
|
|
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.
|
|
Issue #440
|
|
With the changing of receive semantics the parser has been putting the rhs
expression in the first argument of expr_recv and the lhs in the second, and
all subsequent passes have been referring to them backwords (but still doing
the right thing because they were assuming that lhs was the port and rhs was
the receiver).
This makes all code agree on what lhs and rhs mean for receive expressions.
|
|
Issue #487
|
|
|
|
Issue #487
|
|
Issue #487
|
|
The pretty-printer needs access to the crate attributes in order to reproduce
inner crate attributes in standalone .rs files
Issue #487
|
|
Issue #487
|
|
Issue #487
|
|
|
|
Issue #487
|