Skip to content

Commit

Permalink
lex: Use new libcpp API from upstream
Browse files Browse the repository at this point in the history
gcc/rust/ChangeLog:

	* lex/rust-lex.cc (is_identifier_start): Call functions and enum
	variants with proper prefix.
	(is_identifier_continue): Likewise.
	* lex/rust-lex.h: Update copyright year.
  • Loading branch information
CohenArthur committed Jan 17, 2024
1 parent e65d45e commit 97f7e51
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions gcc/rust/lex/rust-lex.cc
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,14 @@ is_non_decimal_int_literal_separator (uint32_t character)
bool
is_identifier_start (uint32_t codepoint)
{
return (check_xid_property (codepoint) & XID_START) || codepoint == '_';
return (cpp_check_xid_property (codepoint) & CPP_XID_START)
|| codepoint == '_';
}

bool
is_identifier_continue (uint32_t codepoint)
{
return check_xid_property (codepoint) & XID_CONTINUE;
return cpp_check_xid_property (codepoint) & CPP_XID_CONTINUE;
}

Lexer::Lexer (const std::string &input, Linemap *linemap)
Expand Down
2 changes: 1 addition & 1 deletion gcc/rust/lex/rust-lex.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2020-2023 Free Software Foundation, Inc.
// Copyright (C) 2020-2024 Free Software Foundation, Inc.

// This file is part of GCC.

Expand Down

0 comments on commit 97f7e51

Please sign in to comment.