Unexpected error in VB.Net Syntax Editor.

SyntaxEditor .NET Languages Add-on for WPF Forum

Posted 10 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 10 years ago]

Comments (1)

Answer - Posted 10 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 (v24.1.1) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.