Error in AST when record is used as a variable name

SyntaxEditor .NET Languages Add-on for WPF Forum

The latest build of this product (v25.1.2) was released 9 days ago, which was before this thread was created.
Posted 2 days ago by Tobias Lingemann - Software Devolpment Engineer, Vector Informatik GmbH
Version: 25.1.2
Platform: .NET 8
Environment: Windows 11 (64-bit)
Avatar

Hi,

we noticed a problem with the C# parser when the keyword "record" is used as a variable name. The C# compiler does not seem to have an issue with this. But here this causes two issues. Firstly the outlining node ends abruptly at the keyword. Secondly the following methods are sometimes missing in the AST. Since we use the AST to generate files, these methods are then missing. Example:

public class test
{
  public static void a()
  {
    var record = "";
    record += "";
  }

  public static void b()
  {
  }
}


Best regards, Tobias Lingemann.

Comments (1)

Answer - Posted 1 days ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Tobias,

Thank you for letting us know about this.  We've made some updates to the C# grammar for the next version to resolve this.

In the meantime, you could work around it by naming the variable "@record" instead of "record".


Actipro Software Support

Add Comment

Please log in to a validated account to post comments.