about summary refs log tree commit diff
path: root/src/grammar
AgeCommit message (Collapse)AuthorLines
2015-01-14Update grammar/verify.rs to work with recent masterFlorian Hahn-9/+9
2015-01-13Handle question marks in model lexer, closes #15879Florian Hahn-0/+6
2015-01-05Un-gate macro_rulesKeegan McAllister-1/+1
2015-01-05Modernize macro_rules! invocationsKeegan McAllister-2/+2
macro_rules! is like an item that defines a macro. Other items don't have a trailing semicolon, or use a paren-delimited body. If there's an argument for matching the invocation syntax, e.g. parentheses for an expr macro, then I think that applies more strongly to the *inner* delimiters on the LHS, wrapping the individual argument patterns.
2015-01-05Replace #[phase] with #[plugin] / #[macro_use] / #[no_link]Keegan McAllister-3/+2
2015-01-03Remove deprecated functionalityAlex Crichton-4/+3
This removes a large array of deprecated functionality, regardless of how recently it was deprecated. The purpose of this commit is to clean out the standard libraries and compiler for the upcoming alpha release. Some notable compiler changes were to enable warnings for all now-deprecated command line arguments (previously the deprecated versions were silently accepted) as well as removing deriving(Zero) entirely (the trait was removed). The distribution no longer contains the libtime or libregex_macros crates. Both of these have been deprecated for some time and are available externally.
2015-01-03sed -i -s 's/\bmod,/self,/g' **/*.rsJorge Aparicio-1/+1
2014-12-30Update src/grammar/README.mdFlorian Hahn-2/+2
2014-12-30src/grammar/check.sh now prints test summaryFlorian Hahn-0/+17
2014-12-30Handle function calls to integers in model lexer correctlyFlorian Hahn-2/+58
closes #15877
2014-12-29rollup merge of #20310: fhahn/issue-15877-model-lexer-rangeAlex Crichton-1/+2
This patch for #15877 uses Antlr's input lookahead (`_input.LA(1) != '.'`) to solve the conflict between the LIT_FLOAT and the range syntax. Note that in order to execute the grammar tests, #20245 should land first.
2014-12-29Handle range in model lexer correctly #15877Florian Hahn-1/+2
2014-12-29Update grammer/verify.rs to work with recent masterFlorian Hahn-30/+32
2014-12-14Modify `regex::Captures::{at,name}` to return `Option`Eric Kidd-4/+4
Closes #14602. As discussed in that issue, the existing `at` and `name` functions represent two different results with the empty string: 1. Matched the empty string. 2. Did not match anything. Consider the following example. This regex has two named matched groups, `key` and `value`. `value` is optional: ```rust // Matches "foo", "foo;v=bar" and "foo;v=". regex!(r"(?P<key>[a-z]+)(;v=(?P<value>[a-z]*))?"); ``` We can access `value` using `caps.name("value")`, but there's no way for us to distinguish between the `"foo"` and `"foo;v="` cases. Early this year, @BurntSushi recommended modifying the existing `at` and `name` functions to return `Option`, instead of adding new functions to the API. This is a [breaking-change], but the fix is easy: - `refs.at(1)` becomes `refs.at(1).unwrap_or("")`. - `refs.name(name)` becomes `refs.name(name).unwrap_or("")`.
2014-11-20Adjust Antlr4 lexer to include suffixes.Huon Wilson-29/+15
This makes the formal lexical grammar (more closely) reflect the one implemented by the compiler.
2014-11-19Update src/grammar for language changes.Huon Wilson-20/+21
2014-11-19Switch to an independent enum for `Lit*` subtokens.Huon Wilson-24/+26
2014-11-17Fallout from deprecationAaron Turon-1/+1
This commit handles the fallout from deprecating `_with` and `_equiv` methods.
2014-10-30Use common variants for open and close delimitersBrendan Zabarauskas-6/+6
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-29Rename fail! to panic!Steve Klabnik-2/+2
https://github.com/rust-lang/rfcs/pull/221 The current terminology of "task failure" often causes problems when writing or speaking about code. You often want to talk about the possibility of an operation that returns a Result "failing", but cannot because of the ambiguity with task failure. Instead, you have to speak of "the failing case" or "when the operation does not succeed" or other circumlocutions. Likewise, we use a "Failure" header in rustdoc to describe when operations may fail the task, but it would often be helpful to separate out a section describing the "Err-producing" case. We have been steadily moving away from task failure and toward Result as an error-handling mechanism, so we should optimize our terminology accordingly: Result-producing functions should be easy to describe. To update your code, rename any call to `fail!` to `panic!` instead. Assuming you have not created your own macro named `panic!`, this will work on UNIX based systems: grep -lZR 'fail!' . | xargs -0 -l sed -i -e 's/fail!/panic!/g' You can of course also do this by hand. [breaking-change]
2014-10-28Use an enum rather than a bool in token::IdentBrendan Zabarauskas-2/+3
2014-10-28Use PascalCase for token variantsBrendan Zabarauskas-100/+102
2014-09-29Update ANTLR float suffix grammarPatrick Reisert-2/+1
- Removes f128 from the grammar, which is no longer support in rustc - The fragment modifier is added so it won't parse float suffix as a separate token
2014-09-18Fix fallout in tests from removing the use of Gc in ExpnInfo.Eduard Burtescu-1/+1
2014-07-27adding proof of context-sensitivy of raw string literalsAlexis Beingessner-6/+41
2014-07-21Don't run lexer tests by defaultCorey Richardson-2/+3
2014-07-21Add a ton of ignore-lexer-testCorey Richardson-1/+1
2014-07-21Shuffle around check-lexer conditionsCorey Richardson-13/+41
2014-07-21Break apart long lines in verify.rsCorey Richardson-1/+3
2014-07-21lexer tests: makefile/configureCorey Richardson-2/+25
2014-07-21Byte/raw binary literal fixesCorey Richardson-4/+24
2014-07-21Refine the tooling, handle commentsCorey Richardson-31/+68
2014-07-21First pass at line comment correctnessCorey Richardson-15/+30
2014-07-21Add raw string literal ambiguity documentCorey Richardson-0/+29
2014-07-21Lexer; subtly wrong; no makefileCorey Richardson-0/+401