| Age | Commit message (Collapse) | Author | Lines |
|
|
|
Conflicts:
src/comp/driver/driver.rs
src/comp/middle/trans/base.rs
src/comp/syntax/parse/lexer.rs
|
|
Removes a bunch of (eventually) unused arguments. Makes span passing to debuginfo
explicit, instead of relying on the (usually incorrect) spans held in the contexts.
Closes #1439
|
|
It's less likely to clash with something than 'neg'.
Issue #1520
|
|
|
|
Closes #1438
|
|
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
|
|
The method `op_index` (which takes a single argument) is used for
this.
Issue #1520
|
|
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
|
|
Closes #1665
|
|
It was being used as a clumsy synonym of ty_fn.
|
|
|
|
|
|
|
|
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)
|
|
Closes #1661
|
|
This should reduce confusion of people trying to read the code.
|
|
The parser no longer parsed them.
|
|
Closes #1659
|
|
|
|
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.
|
|
|
|
|
|
|
|
the replacement and not the span of the pattern variable.
Fixes issue #1448, and #1387.
|
|
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.
|
|
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).
|
|
that way.
|
|
Need a better fix, right now it is just causing even more confusion,
for example in issue #1448 and #1387.
This reverts commit 1e4de333740690357a8f58883c5c69bf58be1424.
|
|
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.
|
|
position.
To match the init_fn() and init_fn_mut() changes.
|
|
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.
|
|
Close #1428.
|
|
|
|
tests accordingly.
|
|
|
|
|
|
|
|
|
|
|
|
This is not my ideal way of going about things. I'd prefer not
to have expressions typed as fn*(), for example, but I couldn't
get that to work together with inferring the modes of arguments
and other corner cases.
|
|
(Commit also includes lots of changes to remove '.'s that a git
merge messed up, or else it was monkeys.)
|
|
Does what it says on the tin.
The next commit will remove support for this syntax.
|
|
|
|
|
|
|
|
|
|
It is reserved for indicating the crate, but doesn't exist in the AST
|
|
|
|
This commit allows patterns like:
alt x { some(_) { ... } none { } }
without the '.' after none. The parser suspends judgment about
whether a bare ident is a tag or a new bound variable; instead,
the resolver disambiguates.
This means that any code after resolution that pattern-matches on
patterns needs to call pat_util::normalize_pat, which consults
an environment to do this disambiguation.
In addition, local variables are no longer allowed to shadow
tag names, so this required changing some code (e.g. renaming
variables named "mut", and renaming ast::sub to subtract).
The parser currently accepts patterns with and without the '.'.
Once the compiler and libraries are changed, it will no longer
accept the '.'.
|