Unexpected error in VB.Net Syntax Editor.

SyntaxEditor .NET Languages Add-on for WPF Forum

Posted 6 years ago by Sreeram Akella
Version: 13.2.0592
Platform: .NET 4.0
Environment: Windows 7 (64-bit)
Avatar

Hi, 

We are using actipro syntax editor's VB.Net addon in our product. Recently I found that the editor complains about a valid piece of code. Here is the code, 

Sub Count
Static Dim tmp As Boolean
tmp = Not tmp
End Sub

The editor throws an error, "Identifier expected", while the same code compiles in Visual Studio 2013 /2010 without any issue. I am not a VB.net developer, however, I understood from some VB.Net forums that Dim is optional in this context.

Is this is a bug or expected behaviour?

Thanks,

Ram. 

[Modified 6 years ago]

Comments (1)

Answer - Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Streeram,

According to the VB 10 official specification, a local modifier (part of a local variable declaration statement) is defined as:

LocalDeclarationStatement  ::=  LocalModifier  VariableDeclarators  StatementTerminator
LocalModifier  ::=  Static  |  Dim  |  Const

You can see there by the EBNF that only a single one of those modifiers is allowed.  Fields (variables defined outside of a Sub) do however allow multiple modifiers.  But per the spec, our grammar is coded correctly.


Actipro Software Support

The latest build of this product (v2019.1 build 0684) was released 17 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.