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.
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.
Now that core exports "option" as a synonym for option::t, search-and-
replace option::t with option.
The only place that still refers to option::t are the modules in libcore
that use option, because fixing this requires a new snapshot
(forthcoming).
All the files below had at least one instance of the ternary operator
present in the source. All have been changed to the equivalent
if/then/else expression.
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
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
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
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)