969: Add builtin macros framework r=CohenArthur a=CohenArthur
This PR adds bases to define new builtin macro functions.
Since we operate at the `insert_macro_def` level, this requires builtin macros to be defined, as is the case in the rust standard library:
```rust
macro_rules! assert {
($cond:expr $(,)?) => {{ /* compiler built-in */ }};
($cond:expr, $($arg:tt)+) => {{ /* compiler built-in */ }};
}
```
Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
956: Substitute repetitions r=CohenArthur a=CohenArthur
Needs #955
This PR splits up the `substitute_tokens` function into multiple smaller functions. Still a draft until I can get repetitions working.
Closes#960Closes#961
Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
953: Refactor lang item mappings r=philberty a=philberty
This refactors how we find our lang items so that during HIR lowering
we have a generic outer attributes handler on Items. The old code only
done lang item mappings during the type check pass and assumed all
lang items are Traits which is not the case. To implement slices range
syntax actually map to structs within libcore/ops/range.rs which have
lang items on structs. This means we can have lang items on any Item.
Co-authored-by: Philip Herron <philip.herron@embecosm.com>
This class keeps track of all known builtin attributes and specifies which
pass they are handled at. This replaces the checks we added for outer
attributes during hir lowering making it a more maintainable data
structure.
964: Forbid unresolved test cases r=CohenArthur a=CohenArthur
Closes#923
965: macro-invoc-lexer: Split implementation in its own file r=CohenArthur a=CohenArthur
Closes#949
Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
950: Match macro repetitions r=CohenArthur a=CohenArthur
This PR adds support for matching macro invocations and counting the amount of times they've been matched
Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
951: Add name resolution to slices r=philberty a=philberty
This is the first part to support slices where we complete the name
resolution of the SliceType with its element as well as the range
expressions used in construction.
This patch also includes separation of the implementation from the
headers to try and incrementally improve build speed.
Addresses #849
Co-authored-by: Philip Herron <philip.herron@embecosm.com>
944: parser: Add `clear_errors()` method r=CohenArthur a=CohenArthur
Clears all errors from the error table so we can reuse the parser in later situations. I'm unsure whether or not the method should also emit all of the errors if present? In that case, we might want to rename it or add another wrapper that emits then clears
Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
942: Removed Lambda Function within AST::PathPattern r=philberty a=mvvsmk
Addresses issue #717
1) Changed the rust-path.h and removed the iterate_path_segments
fuction.
2) Removed the lambda fuction form rust-ast-lower.cc and replaced it
with a for loop.
Do let me know if I missed anything or could improve on something.
Signed-off-by : M V V S Manoj Kumar <mvvsmanojkumar@gmail.com>
Co-authored-by: M V V S Manoj Kumar <mvvsmanojkumar@gmail.com>
940: Add more location info to AST structures r=CohenArthur a=CohenArthur
Two classes still remain locus-less: `TupleStructItems` and `TuplePatternItems` as I do not believe they are constructed at the moment.
Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>