about summary refs log tree commit diff
path: root/src/libsyntax/ext/asm.rs
AgeCommit message (Collapse)AuthorLines
2015-01-14Disallow a form of invalid asm! macroSimonas Kazlauskas-0/+6
Fixes #21045
2015-01-07use slicing sugarJorge Aparicio-2/+2
2015-01-07Replace full slice notation with index callsNick Cameron-1/+1
2014-12-21Fallout of std::str stabilizationAlex Crichton-2/+1
2014-12-03Replace `equiv` method calls with `==` operator sugarJorge Aparicio-4/+4
2014-11-30auto merge of #19415 : P1start/rust/error-message-fixes, r=alexcrichtonbors-1/+1
This is the style followed by most other error messages.
2014-11-30Adjust some error messages to start with a lowercase letter and not finish ↵P1start-1/+1
with a full stop
2014-11-30syntax: Make `asm!` clobbers a proper vector.Kang Seonghoon-7/+3
Otherwise `--pretty expanded` diverges.
2014-11-18rollup merge of #18911: canndrew/slice_shift_charJakub Bukaj-2/+2
`slice_shift_char` splits a `str` into it's leading `char` and the remainder of the `str`. Currently, it returns a `(Option<char>, &str)` such that: "bar".slice_shift_char() => (Some('b'), "ar") "ar".slice_shift_char() => (Some('a'), "r") "r".slice_shift_char() => (Some('r'), "") "".slice_shift_char() => (None, "") This is a little odd. Either a `str` can be split into both a head and a tail or it cannot. So the return type should be `Option<(char, &str)>`. With the current behaviour, in the case of the empty string, the `str` returned is meaningless - it is always the empty string. This PR changes `slice_shift_char` so that: "bar".slice_shift_char() => Some(('b', "ar")) "ar".slice_shift_char() => Some(('a', "r")) "r".slice_shift_char() => Some(('r', "")) "".slice_shift_char() => None
2014-11-17Switch to purely namespaced enumsSteven Fackler-0/+1
This breaks code that referred to variant names in the same namespace as their enum. Reexport the variants in the old location or alter code to refer to the new locations: ``` pub enum Foo { A, B } fn main() { let a = A; } ``` => ``` pub use self::Foo::{A, B}; pub enum Foo { A, B } fn main() { let a = A; } ``` or ``` pub enum Foo { A, B } fn main() { let a = Foo::A; } ``` [breaking-change]
2014-11-17change return type of slice_shift_charAndrew Cann-2/+2
`slice_shift_char` splits a `str` into it's leading `char` and the remainder of the `str`. Currently, it returns a `(Option<char>, &str)` such that: "bar".slice_shift_char() => (Some('b'), "ar") "ar".slice_shift_char() => (Some('a'), "r") "r".slice_shift_char() => (Some('r'), "") "".slice_shift_char() => (None, "") This is a little odd. Either a `str` can be split into both a head and a tail or it cannot. So the return type should be `Option<(char, &str)>`. With the current behaviour, in the case of the empty string, the `str` returned is meaningless - it is always the empty string. This commit changes slice_shift_char so that: "bar".slice_shift_char() => Some(('b', "ar")) "ar".slice_shift_char() => Some(('a', "r")) "r".slice_shift_char() => Some(('r', "")) "".slice_shift_char() => None [breaking-change]
2014-10-30Use common variants for open and close delimitersBrendan Zabarauskas-4/+4
This common representation for delimeters should make pattern matching easier. Having a separate `token::DelimToken` enum also allows us to enforce the invariant that the opening and closing delimiters must be the same in `ast::TtDelimited`, removing the need to ensure matched delimiters when working with token trees.
2014-10-28Use PascalCase for token variantsBrendan Zabarauskas-23/+23
2014-09-28Keep ExpnId abstract by providing conversionsKeegan McAllister-1/+1
2014-09-27Translate inline assembly errors back to source locationsKeegan McAllister-1/+12
Fixes #17552.
2014-09-14syntax: fix fallout from using ptr::P.Eduard Burtescu-4/+3
2014-08-27Implement generalized object and type parameter bounds (Fixes #16462)Niko Matsakis-2/+2
2014-08-24Adjust the error messages to match the pattern "expected foo, found bar"Jonas Hietala-1/+1
Closes #8492
2014-08-19Fix double evaluation of read+write operandsPiotr Czarnecki-14/+4
Stop read+write expressions from expanding into two occurences in the AST. Add a bool to indicate whether an operand in output position if read+write or not. Fixes #14936
2014-07-08std: Rename the `ToStr` trait to `ToString`, and `to_str` to `to_string`.Richo Healey-2/+2
[breaking-change]
2014-07-03Simplify creating a parser from a token treePiotr Jawniak-7/+1
Closes #15306
2014-06-15Register new snapshotsAlex Crichton-23/+0
2014-06-14rustc: Obsolete the `@` syntax entirelyAlex Crichton-0/+2
This removes all remnants of `@` pointers from rustc. Additionally, this removes the `GC` structure from the prelude as it seems odd exporting an experimental type in the prelude by default. Closes #14193 [breaking-change]
2014-06-11std: Remove i18n/l10n from format!Alex Crichton-0/+23
* The select/plural methods from format strings are removed * The # character no longer needs to be escaped * The \-based escapes have been removed * '{{' is now an escape for '{' * '}}' is now an escape for '}' Closes #14810 [breaking-change]
2014-06-11syntax: Move the AST from @T to Gc<T>Alex Crichton-2/+1
2014-05-27std: Remove String's to_ownedRicho Healey-1/+1
2014-05-22libcore: Remove all uses of `~str` from `libcore`.Patrick Walton-1/+3
[breaking-change]
2014-05-22libstd: Remove all uses of `~str` from `libstd`Patrick Walton-1/+1
2014-05-22libstd: Remove `~str` from all `libstd` modules except `fmt` and `str`.Patrick Walton-1/+2
2014-05-06librustc: Remove `~EXPR`, `~TYPE`, and `~PAT` from the language, exceptPatrick Walton-1/+2
for `~str`/`~[]`. Note that `~self` still remains, since I forgot to add support for `Box<self>` before the snapshot. How to update your code: * Instead of `~EXPR`, you should write `box EXPR`. * Instead of `~TYPE`, you should write `Box<Type>`. * Instead of `~PATTERN`, you should write `box PATTERN`. [breaking-change]
2014-04-18Replace all ~"" with "".to_owned()Richo Healey-1/+1
2014-04-16syntax: unify all MacResult's into a single trait.Huon Wilson-3/+3
There's now one unified way to return things from a macro, instead of being able to choose the `AnyMacro` trait or the `MRItem`/`MRExpr` variants of the `MacResult` enum. This does simplify the logic handling the expansions, but the biggest value of this is it makes macros in (for example) type position easier to implement, as there's this single thing to modify. By my measurements (using `-Z time-passes` on libstd and librustc etc.), this appears to have little-to-no impact on expansion speed. There are presumably larger costs than the small number of extra allocations and virtual calls this adds (notably, all `macro_rules!`-defined macros have not changed in behaviour, since they had to use the `AnyMacro` trait anyway).
2014-03-20Removing imports of std::vec_ng::VecAlex Crichton-2/+0
It's now in the prelude.
2014-03-20rename std::vec_ng -> std::vecDaniel Micay-1/+1
Closes #12771
2014-03-13Fix and improve inline assembly.Piotr Czarnecki-50/+69
Read+write modifier Some documentation in asm.rs rpass and cfail tests
2014-03-01libsyntax: Fix errors arising from the automated `~[T]` conversionPatrick Walton-1/+5
2014-03-01libsyntax: Mechanically change `~[T]` to `Vec<T>`Patrick Walton-3/+3
2014-02-18Avoid returning original macro if expansion fails.Douglas Young-1/+1
Closes #11692. Instead of returning the original expression, a dummy expression (with identical span) is returned. This prevents infinite loops of failed expansions as well as odd double error messages in certain situations.
2014-02-02libsyntax: Remove all `@str` from the ASTPatrick Walton-9/+9
2014-02-02libsyntax: De-`@str` literal strings in the ASTPatrick Walton-2/+3
2014-01-18syntax::ext: replace span_fatal with span_err in many places.Huon Wilson-3/+6
This means that compilation continues for longer, and so we can see more errors per compile. This is mildly more user-friendly because it stops users having to run rustc n times to see n macro errors: just run it once to see all of them.
2014-01-09libsyntax: Renamed types, traits and enum variants to CamelCase.Eduard Burtescu-4/+4
2014-01-02libsyntax: De-`@mut` `Parser::last_span`Patrick Walton-4/+4
2014-01-02libsyntax: De-`@mut` `token` in the parserPatrick Walton-16/+16
2014-01-02libsyntax: Make the parser mutablePatrick Walton-3/+3
2013-12-29Start passing around &mut ExtCtxtSteven Fackler-1/+1
2013-12-28Stop using @ExtCtxtSteven Fackler-1/+1
2013-10-18Handle inline asm outputs as write-only in liveness, borrowck and trans.Eduard Burtescu-6/+15
2013-10-08add new enum ast::StrStyle as field to ast::lit_strBenjamin Herr-6/+12
For the benefit of the pretty printer we want to keep track of how string literals in the ast were originally represented in the source code. This commit changes parser functions so they don't extract strings from the token stream without at least also returning what style of string literal it was. This is stored in the resulting ast node for string literals, obviously, for the package id in `extern mod = r"package id"` view items, for the inline asm in `asm!()` invocations. For `asm!()`'s other arguments or for `extern "Rust" fn()` items, I just the style of string, because it seemed disproportionally cumbersome to thread that information through the string processing that happens with those string literals, given the limited advantage raw string literals would provide in these positions. The other syntax extensions don't seem to store passed string literals in the ast, so they also discard the style of strings they parse.
2013-09-30syntax: Remove usage of fmt!Alex Crichton-1/+1