about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2014-07-11Add scaffolding for assigning alpha-numeric codes to rustc diagnosticsJakub Wieczorek-63/+307
2014-07-10auto merge of #15556 : alexcrichton/rust/snapshots, r=brsonbors-142/+0
Closes #15544
2014-07-09auto merge of #15514 : luqmana/rust/die-advance-die, r=cmrbors-21/+6
Closes #15492.
2014-07-09libsyntax: Remove uses of advance.Luqman Aden-21/+6
2014-07-09syntax: De-doc comment to fix nightliesAlex Crichton-50/+50
This reverts the promotion from line-comment to doc-comment in 4989a56 to fix the compiler-docs target. Closes #15553
2014-07-09Register new snapshotsAlex Crichton-142/+0
Closes #15544
2014-07-09Fix all the test falloutCorey Richardson-86/+98
2014-07-09ast: make Name its own typeCorey Richardson-104/+147
2014-07-09lexer: lex WS/COMMENT/SHEBANG rather than skippingCorey Richardson-62/+118
Now, the lexer will categorize every byte in its input according to the grammar. The parser skips over these while parsing, thus avoiding their presence in the input to syntax extensions.
2014-07-09syntax: don't parse numeric literals in the lexerCorey Richardson-264/+323
This removes a bunch of token types. Tokens now store the original, unaltered numeric literal (that is still checked for correctness), which is parsed into an actual number later, as needed, when creating the AST. This can change how syntax extensions work, but otherwise poses no visible changes. [breaking-change]
2014-07-09syntax: don't process string/char/byte/binary litsCorey Richardson-81/+312
This shuffles things around a bit so that LIT_CHAR and co store an Ident which is the original, unaltered literal in the source. When creating the AST, unescape and postprocess them. This changes how syntax extensions can work, slightly, but otherwise poses no visible changes. To get a useful value out of one of these tokens, call `parse::{char_lit, byte_lit, bin_lit, str_lit}` [breaking-change]
2014-07-09ast: add an `as_str` method to IdentCorey Richardson-0/+7
This is technically unsafe but interned strings are considered immortal.
2014-07-09lexer: add ident_from and ident_from_to methodsCorey Richardson-0/+14
2014-07-09lexer: shuffle around some functionsCorey Richardson-99/+100
2014-07-09codemap: be less annoying in debug loggingCorey Richardson-5/+4
2014-07-09syntax: use a better Show impl for IdentCorey Richardson-2/+8
Rather than just dumping the id in the interner, which is useless, actually print the interned string. Adjust the lexer logging to use Show instead of Poly.
2014-07-09token: replace ast::Ident with just IdentCorey Richardson-18/+19
2014-07-09syntax: doc comments all the thingsCorey Richardson-1137/+1136
2014-07-08carry self ident forward through re-parsingJohn Clements-52/+82
formerly, the self identifier was being discarded during parsing, which stymies hygiene. The best fix here seems to be to attach a self identifier to ExplicitSelf_, a change that rippled through the rest of the compiler, but without any obvious damage.
2014-07-08macro literals should be compared by name onlyJohn Clements-2/+9
2014-07-08commentsJohn Clements-0/+1
2014-07-08remove outdated commentJohn Clements-12/+0
I believe this comment is now irrelevant, as a result of commit 6757053cffb585249105fbd76f
2014-07-08implement hygiene for method argsJohn Clements-0/+25
2014-07-08test case for expansion of method macroJohn Clements-2/+13
2014-07-08introducing let-syntaxJohn Clements-2/+27
The let-syntax expander is different in that it doesn't apply a mark to its token trees before expansion. This is used for macro_rules, and it's because macro_rules is essentially MTWT's let-syntax. You don't want to mark before expand sees let-syntax, because there's no "after" syntax to mark again. In some sense, the cleaner approach might be to introduce a new AST node that macro_rules expands into; this would make it clearer that the expansion of a macro is distinct from the addition of a new macro binding. This should work for now, though...
2014-07-08self arg macro test caseJohn Clements-0/+13
2014-07-08replace idents with namesJohn Clements-0/+5
2014-07-08get rid of keyword idents, replace with namesJohn Clements-8/+8
should prevent future bugs
2014-07-08preserve context in parsing of `self` varrefJohn Clements-9/+11
2014-07-08remove unused fn, make SELF_KEYWORD_NAME publicJohn Clements-5/+1
2014-07-08test harness cleanupJohn Clements-27/+20
2014-07-08change if/else to matchJohn Clements-179/+197
2014-07-08added test for method arg hygieneJohn Clements-0/+13
2014-07-08auto merge of #15493 : brson/rust/tostr, r=pcwaltonbors-147/+287
This updates https://github.com/rust-lang/rust/pull/15075. Rename `ToStr::to_str` to `ToString::to_string`. The naive renaming ends up with two `to_string` functions defined on strings in the prelude (the other defined via `collections::str::StrAllocating`). To remedy this I removed `StrAllocating::to_string`, making all conversions from `&str` to `String` go through `Show`. This has a measurable impact on the speed of this conversion, but the sense I get from others is that it's best to go ahead and unify `to_string` and address performance for all `to_string` conversions in `core::fmt`. `String::from_str(...)` still works as a manual fast-path. Note that the patch was done with a script, and ended up renaming a number of other `*_to_str` functions, particularly inside of rustc. All the ones I saw looked correct, and I didn't notice any additional API breakage. Closes #15046.
2014-07-08std: Rename the `ToStr` trait to `ToString`, and `to_str` to `to_string`.Richo Healey-147/+287
[breaking-change]
2014-07-08Change DST syntax: type -> Sized?Nick Cameron-55/+89
closes #13367 [breaking-change] Use `Sized?` to indicate a dynamically sized type parameter or trait (used to be `type`). E.g., ``` trait Tr for Sized? {} fn foo<Sized? X: Share>(x: X) {} ```
2014-07-07Improve non-exhaustive pattern witnesses for structs with multiple fieldsJakub Wieczorek-2/+4
2014-07-05Add #[crate_name] attributes as necessaryAlex Crichton-1/+3
2014-07-05rustc: Remove CrateId and all related supportAlex Crichton-13/+8
This commit removes all support in the compiler for the #[crate_id] attribute and all of its derivative infrastructure. A list of the functionality removed is: * The #[crate_id] attribute no longer exists * There is no longer the concept of a version of a crate * Version numbers are no longer appended to symbol names * The --crate-id command line option has been removed To migrate forward, rename #[crate_id] to #[crate_name] and only the name of the crate itself should be mentioned. The version/path of the old crate id should be removed. For a transitionary state, the #[crate_id] attribute is still accepted if the #[crate_name] is not present, but it is warned about if it is the only identifier present. RFC: 0035-remove-crate-id [breaking-change]
2014-07-05auto merge of #15428 : phildawes/rust/master, r=huonwbors-2/+3
Fix small bug introduced in e38cb972dcf: PatIdent span was incorrect because self.last_span was being used before the ident token was parsed.
2014-07-05auto merge of #15427 : aochagavia/rust/parse, r=pcwaltonbors-16/+2
2014-07-05auto merge of #15425 : jbclements/rust/hygiene-for-3-kinds-of-args, r=cmrbors-111/+284
This pull request adds hygiene for 3 kinds of argument bindings: - arguments to item fns, - arguments to `ExprFnBlock`s, and - arguments to `ExprProc`s It also adds a bunch of unit tests, fixes a few macro uses to be non-capturing, and has a few cleanup items. local `make check` succeeds.
2014-07-04Parser: fix PatIdent span bugPhil Dawes-2/+3
Fix small bug introduced in e38cb972dcf: PatIdent span was incorrect because self.last_span was being used before the ident token was parsed.
2014-07-04Removed unnecessary method in testAdolfo OchagavĂ­a-16/+2
2014-07-04implement hygiene for ExprFnBlock and ExprProcJohn Clements-1/+15
2014-07-04added test cases for closure arg hygieneJohn Clements-0/+22
2014-07-04comments onlyJohn Clements-3/+2
2014-07-04hygiene for item fn argsJohn Clements-7/+49
also, introduce fn_decl_arg_bindings and expand_and_rename abstractions
2014-07-04comments & test cases for IdentRenamersJohn Clements-11/+63
2014-07-04use PatIdentRenamer for match bindingsJohn Clements-10/+5