diff options
| author | Florian Hahn <flo@fhahn.com> | 2015-01-13 23:31:53 +0100 |
|---|---|---|
| committer | Florian Hahn <flo@fhahn.com> | 2015-01-13 23:31:53 +0100 |
| commit | d397a3e6545b7ac22c9bce383465e0b3c595587f (patch) | |
| tree | 22e0149fde858689a33205b6f96c046a74dc78f5 | |
| parent | 4fd1e6235dd241939475f79c8f58a455f5996690 (diff) | |
| download | rust-d397a3e6545b7ac22c9bce383465e0b3c595587f.tar.gz rust-d397a3e6545b7ac22c9bce383465e0b3c595587f.zip | |
Handle question marks in model lexer, closes #15879
| -rw-r--r-- | src/grammar/RustLexer.g4 | 5 | ||||
| -rw-r--r-- | src/grammar/verify.rs | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/grammar/RustLexer.g4 b/src/grammar/RustLexer.g4 index 88de5db41fe..7d071d5e724 100644 --- a/src/grammar/RustLexer.g4 +++ b/src/grammar/RustLexer.g4 @@ -194,8 +194,13 @@ LIT_STR_RAW : 'r' LIT_STR_RAW_INNER SUFFIX? ; + +QUESTION : '?'; + IDENT : XID_start XID_continue* ; +fragment QUESTION_IDENTIFIER : QUESTION? IDENT; + LIFETIME : '\'' IDENT ; WHITESPACE : [ \r\n\t]+ ; diff --git a/src/grammar/verify.rs b/src/grammar/verify.rs index 9194c7a4766..86610602e88 100644 --- a/src/grammar/verify.rs +++ b/src/grammar/verify.rs @@ -107,6 +107,7 @@ fn parse_token_list(file: &str) -> HashMap<String, token::Token> { "LE" => token::Le, "LIT_BINARY" => token::Literal(token::Binary(Name(0)), None), "LIT_BINARY_RAW" => token::Literal(token::BinaryRaw(Name(0), 0), None), + "QUESTION" => token::Question, _ => continue, }; |
