Skip to content

Parser does not treat properly raw identifiers that represent keywords #7066

Closed
@ironcev

Description

@ironcev

Parser does not treat properly raw identifiers that represent keywords, at least some of them. E.g., while this compiles:

library;

fn raw_identifiers() {
   let r#not_a_keyword = true;
   if r#not_a_keyword { }
   while r#not_a_keyword { }
}

if we have keywords in raw identifiers we get parser errors:

library;

fn raw_identifiers() {
   let r#return = true;
   if r#return { }      // ERROR: Expected an opening brace. 
   while r#return { }   // ERROR: Expected an opening brace. 
   
   let r#if = true;
   if r#if { }          // ERROR: Expected an opening brace. 
   while r#if { }       // ERROR: Expected an opening brace. 
}

An indicative point is also that both variables r#return and r#if are marked as not being used.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcompilerGeneral compiler. Should eventually become more specific as the issue is triagedcompiler: parserEverything to do with the parserteam:compilerCompiler Team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions