aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/lex/rust-lex.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rust/lex/rust-lex.cc')
-rw-r--r--gcc/rust/lex/rust-lex.cc17
1 files changed, 9 insertions, 8 deletions
diff --git a/gcc/rust/lex/rust-lex.cc b/gcc/rust/lex/rust-lex.cc
index e5c9148..b9f012b 100644
--- a/gcc/rust/lex/rust-lex.cc
+++ b/gcc/rust/lex/rust-lex.cc
@@ -21,7 +21,7 @@
#include "rust-lex.h"
#include "rust-diagnostics.h"
#include "rust-linemap.h"
-#include "rust-session-manager.h"
+#include "rust-edition.h"
#include "safe-ctype.h"
#include "cpplib.h"
#include "rust-keyword-values.h"
@@ -277,9 +277,7 @@ Lexer::classify_keyword (const std::string &str)
// https://doc.rust-lang.org/reference/keywords.html#reserved-keywords
// `try` is not a reserved keyword before 2018
- if (Session::get_instance ().options.get_edition ()
- == CompileOptions::Edition::E2015
- && id == TRY)
+ if (get_rust_edition () == Edition::E2015 && id == TRY)
return IDENTIFIER;
return id;
@@ -589,7 +587,8 @@ Lexer::build_token ()
if (current_char.is_eof ())
{
rust_error_at (
- loc, "unexpected EOF while looking for end of comment");
+ loc, ErrorCode::E0758,
+ "unexpected EOF while looking for end of comment");
break;
}
str += current_char;
@@ -644,7 +643,8 @@ Lexer::build_token ()
if (current_char.is_eof ())
{
rust_error_at (
- loc, "unexpected EOF while looking for end of comment");
+ loc, ErrorCode::E0758,
+ "unexpected EOF while looking for end of comment");
break;
}
@@ -708,7 +708,8 @@ Lexer::build_token ()
if (current_char.is_eof ())
{
rust_error_at (
- loc, "unexpected EOF while looking for end of comment");
+ loc, ErrorCode::E0758,
+ "unexpected EOF while looking for end of comment");
break;
}
@@ -2218,7 +2219,7 @@ Lexer::parse_raw_string (location_t loc, int initial_hash_count)
str.shrink_to_fit ();
- return Token::make_string (loc, std::move (str));
+ return Token::make_raw_string (loc, std::move (str));
}
template <typename IsDigitFunc>