diff runtime/indent/testdir/vb.ok @ 35225:f8e7e00787b5

runtime(vb): update vb indent plugin as vim9script Commit: https://github.com/vim/vim/commit/af2254d2f3c1c59add065363dccb53ddb0edadf5 Author: Michael Soyka <mssr953@gmail.com> Date: Mon May 20 14:37:50 2024 +0200 runtime(vb): update vb indent plugin as vim9script Include an updated vb indent script using vim9script. Also update the runtime indent test files Signed-off-by: Michael Soyka <mssr953@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Mon, 20 May 2024 14:45:02 +0200
parents 7d68a90cbf5c
children
line wrap: on
line diff
--- a/runtime/indent/testdir/vb.ok
+++ b/runtime/indent/testdir/vb.ok
@@ -1,6 +1,16 @@
 ' vim: filetype=vb shiftwidth=4 expandtab
 '
 ' START_INDENT
+#Const Debug = False
+
+#If Win64 Then
+' Win64=true, Win32=true, Win16=false
+#ElseIf Win32 Then
+' Win32=true, Win16=false
+#Else
+' Win16=true
+#End If
+
 Public Type GEmployeeRecord     ' Create user-defined type. 
     ID As Integer               ' Define elements of data type. 
     Name As String * 20 
@@ -95,6 +105,9 @@ Public Sub TestMultiline (cellAddr As St
     Dim rng As Range
 
     Set rng = Range(cellAddr)
+
+    ' Line continuation is implemented as a two-character sequence-
+    ' whitespace followed by underscore.
     With rng
         .Cells(1,1).Value = _
             "Line 1 of multiline string; " & _
@@ -102,14 +115,25 @@ Public Sub TestMultiline (cellAddr As St
             "Line 3 of multiline string"
     End With
 
-    ' The following lines have whitespace after the underscore character
-    ' and therefore do not form a valid multiline statement.  The indent
-    ' script correctly treats them as four single line statements contrary
-    ' to the author's obvious indent.
-    rng..Cells(1,1).Value = _ 
-    "Line 1 of multiline string; " & _ 
-    "Line 2 of multiline string; " & _ 
-    "Line 3 of multiline string"
+    ' This code block omits the leading whitespace character and so 
+    ' the trailing underscore will not be treated as line continuation.
+    With rng
+        .Cells(1,1).Value =_
+        "Line 1 of multiline string; " &_
+        "Line 2 of multiline string; " &_
+        "Line 3 of multiline string"
+    End With
+
+    ' The following lines have whitespace after the underscore character.
+    ' This is contrary to Microsoft documentation but it is reported that
+    ' some Microsoft editors allow it and will still treat the statement
+    ' as line-continued.  
+    With rng
+        rng.Cells(1,1).Value = _ 
+            "Line 1 of multiline string; " & _ 
+            "Line 2 of multiline string; " & _ 
+            "Line 3 of multiline string"
+    End With
 
 End Sub
 
@@ -121,6 +145,18 @@ stmtLabel:
 
 End Sub
 
+Public Static Function TestStatic(addend As Integer)
+    Dim Integer accumulator
+    accumulator = accumulator + addend
+    TestStatic = accumulator
+End Function
+
+Friend Function TestFriend(addend As Integer)
+    Static Integer accumulator
+    accumulator = accumulator + addend
+    TestFriend = accumulator
+End Function
+
 Sub TestTypeKeyword()
     Type EmployeeRecord         ' Create user-defined type. 
         ID As Integer           ' Define elements of data type. 
@@ -131,4 +167,10 @@ Sub TestTypeKeyword()
     End Type 
     Dim varType As EmployeeRecord
 End Sub
+
+Sub TestDateLiteralAfterLineContinuation
+    Dim birthday as Date
+    birthday = _
+        #January 1, 1901#
+End Sub
 ' END_INDENT