Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1359,14 +1359,14 @@ USS (uss)
UXML (uxml)
Vala (vala)
Vala Header (vapi)
VB for Applications (VBA, vba)
VBA (VBA, vba)
Velocity Template Language (vm)
Verilog-SystemVerilog (sv, svh, v)
VHDL (VHD, vhd, VHDL, vhdl, vhf, vhi, vho, vhs, vht, vhw)
vim script (vim)
Visual Basic (BAS, bas, ctl, dsr, frm, FRX, frx, VBHTML, vbhtml, vbp, vbw, cls)
Visual Basic .NET (VB, vb, vbproj)
Visual Basic Script (VBS, vbs)
Visual Basic (BAS, bas, ctl, dsr, Dsr, frm, FRX, frx, vbp, vbw, cls)
Visual Basic .NET (VB, vb, vbproj, vbhtml, VBHTML)
VBScript (VBS, vbs)
Visual Fox Pro (SCA, sca)
Visual Studio Solution (sln)
Visualforce Component (component)
Expand Down
21 changes: 11 additions & 10 deletions Unix/cloc
Original file line number Diff line number Diff line change
Expand Up @@ -9616,17 +9616,18 @@ sub set_constants { # {{{1
'BAS' => 'Visual Basic' ,
'ctl' => 'Visual Basic' ,
'dsr' => 'Visual Basic' ,
'Dsr' => 'Visual Basic' ,
'frm' => 'Visual Basic' ,
'frx' => 'Visual Basic' ,
'FRX' => 'Visual Basic' ,
'vba' => 'VB for Applications' ,
'VBA' => 'VB for Applications' ,
'vbhtml' => 'Visual Basic' ,
'VBHTML' => 'Visual Basic' ,
'vba' => 'VBA' ,
'VBA' => 'VBA' ,
'vbhtml' => 'Visual Basic .NET' ,
'VBHTML' => 'Visual Basic .NET' ,
'vbproj' => 'Visual Basic .NET' ,
'vbp' => 'Visual Basic' , # .vbp - autogenerated
'vbs' => 'Visual Basic Script' ,
'VBS' => 'Visual Basic Script' ,
'vbs' => 'VBScript' ,
'VBS' => 'VBScript' ,
'vb' => 'Visual Basic .NET' ,
'VB' => 'Visual Basic .NET' ,
'vbw' => 'Visual Basic' , # .vbw - autogenerated
Expand Down Expand Up @@ -11484,7 +11485,7 @@ sub set_constants { # {{{1
[ 'remove_matches' , '^\s*"' ],
[ 'remove_inline' , '".*$' ],
],
'Visual Basic Script' => [
'VBScript' => [
[ 'remove_above' , '^\s*Attribute\s+VB_Name\s+=' ],
[ 'remove_matches' , '^\s*Attribute\s+'],
[ 'remove_matches' , '^\s*\47'], # \47 = '
Expand All @@ -11494,7 +11495,7 @@ sub set_constants { # {{{1
[ 'remove_matches' , '^\s*Attribute\s+'],
[ 'remove_matches' , '^\s*\47'], # \47 = '
],
'VB for Applications' => [
'VBA' => [
[ 'remove_above' , '^\s*Attribute\s+VB_Name\s+=' ],
[ 'remove_matches' , '^\s*Attribute\s+'],
[ 'remove_matches' , '^\s*\47'], # \47 = '
Expand Down Expand Up @@ -12225,9 +12226,9 @@ sub set_constants { # {{{1
'VHDL' => 4.21,
'vim script' => 3.00,
'Visual Basic' => 2.76,
'VB for Applications' => 2.76,
'VBA' => 2.76,
'Visual Basic .NET' => 2.76,
'Visual Basic Script' => 2.76,
'VBScript' => 2.76,
'Visual Fox Pro' => 4.00, # Visual Fox Pro is not available in the language gearing ratios listed at Mayes Consulting web site
'Visualforce Component' => 1.9 ,
'Visualforce Page' => 1.9 ,
Expand Down
26 changes: 23 additions & 3 deletions Unix/t/00_C.t
Original file line number Diff line number Diff line change
Expand Up @@ -1433,9 +1433,14 @@ my @Tests = (
'args' => '../tests/inputs/gnureadline.vala',
},
{
'name' => 'VB.Net',
'ref' => '../tests/outputs/VisualBasic.Net.vba.yaml',
'args' => '../tests/inputs/VisualBasic.Net.vba',
'name' => 'VBA',
'ref' => '../tests/outputs/vba_test.vba.yaml',
'args' => '../tests/inputs/vba_test.vba',
},
{
'name' => 'VB.NET',
'ref' => '../tests/outputs/vbnet_test.vb.yaml',
'args' => '../tests/inputs/vbnet_test.vb',
},
{
'name' => 'Velocity Template Language',
Expand All @@ -1452,6 +1457,21 @@ my @Tests = (
'ref' => '../tests/outputs/JetCar.cls.yaml',
'args' => '../tests/inputs/JetCar.cls',
},
{
'name' => 'Visual Basic (Dsr)',
'ref' => '../tests/outputs/test.Dsr.yaml',
'args' => '../tests/inputs/test.Dsr',
},
{
'name' => 'Visual Basic .NET (vbhtml)',
'ref' => '../tests/outputs/test.vbhtml.yaml',
'args' => '../tests/inputs/test.vbhtml',
},
{
'name' => 'VBScript',
'ref' => '../tests/outputs/test.vbs.yaml',
'args' => '../tests/inputs/test.vbs',
},
{
'name' => 'Visual Studio Solution',
'ref' => '../tests/outputs/vs_solution.sln.yaml',
Expand Down
21 changes: 11 additions & 10 deletions cloc
Original file line number Diff line number Diff line change
Expand Up @@ -9608,17 +9608,18 @@ sub set_constants { # {{{1
'BAS' => 'Visual Basic' ,
'ctl' => 'Visual Basic' ,
'dsr' => 'Visual Basic' ,
'Dsr' => 'Visual Basic' ,
'frm' => 'Visual Basic' ,
'frx' => 'Visual Basic' ,
'FRX' => 'Visual Basic' ,
'vba' => 'VB for Applications' ,
'VBA' => 'VB for Applications' ,
'vbhtml' => 'Visual Basic' ,
'VBHTML' => 'Visual Basic' ,
'vba' => 'VBA' ,
'VBA' => 'VBA' ,
'vbhtml' => 'Visual Basic .NET' ,
'VBHTML' => 'Visual Basic .NET' ,
'vbproj' => 'Visual Basic .NET' ,
'vbp' => 'Visual Basic' , # .vbp - autogenerated
'vbs' => 'Visual Basic Script' ,
'VBS' => 'Visual Basic Script' ,
'vbs' => 'VBScript' ,
'VBS' => 'VBScript' ,
'vb' => 'Visual Basic .NET' ,
'VB' => 'Visual Basic .NET' ,
'vbw' => 'Visual Basic' , # .vbw - autogenerated
Expand Down Expand Up @@ -11476,7 +11477,7 @@ sub set_constants { # {{{1
[ 'remove_matches' , '^\s*"' ],
[ 'remove_inline' , '".*$' ],
],
'Visual Basic Script' => [
'VBScript' => [
[ 'remove_above' , '^\s*Attribute\s+VB_Name\s+=' ],
[ 'remove_matches' , '^\s*Attribute\s+'],
[ 'remove_matches' , '^\s*\47'], # \47 = '
Expand All @@ -11486,7 +11487,7 @@ sub set_constants { # {{{1
[ 'remove_matches' , '^\s*Attribute\s+'],
[ 'remove_matches' , '^\s*\47'], # \47 = '
],
'VB for Applications' => [
'VBA' => [
[ 'remove_above' , '^\s*Attribute\s+VB_Name\s+=' ],
[ 'remove_matches' , '^\s*Attribute\s+'],
[ 'remove_matches' , '^\s*\47'], # \47 = '
Expand Down Expand Up @@ -12217,9 +12218,9 @@ sub set_constants { # {{{1
'VHDL' => 4.21,
'vim script' => 3.00,
'Visual Basic' => 2.76,
'VB for Applications' => 2.76,
'VBA' => 2.76,
'Visual Basic .NET' => 2.76,
'Visual Basic Script' => 2.76,
'VBScript' => 2.76,
'Visual Fox Pro' => 4.00, # Visual Fox Pro is not available in the language gearing ratios listed at Mayes Consulting web site
'Visualforce Component' => 1.9 ,
'Visualforce Page' => 1.9 ,
Expand Down
12 changes: 0 additions & 12 deletions tests/inputs/VisualBasic.Net.vba

This file was deleted.

20 changes: 20 additions & 0 deletions tests/inputs/test.Dsr
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "TestClass"
Attribute VB_GlobalNameSpace = False

' This is a comment in a Dsr file
Option Explicit

Public Sub TestMethod()
' Method implementation
Dim x As Integer
x = 42
Debug.Print "Value: " & x
End Sub
18 changes: 18 additions & 0 deletions tests/inputs/test.vbhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@{
' VB.NET code in a vbhtml file
ViewBag.Title = "Test Page"
Dim message As String = "Hello from VB.NET"
}

<!DOCTYPE html>
<html>
<head>
<title>@ViewBag.Title</title>
</head>
<body>
<h1>@message</h1>
@If True Then
@<p>This is a VB.NET HTML template</p>
End If
</body>
</html>
10 changes: 10 additions & 0 deletions tests/inputs/test.vbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
' VBScript test file
' This is a comment
Dim greeting
greeting = "Hello, World!"
WScript.Echo greeting

' Another comment
If 1 = 1 Then
WScript.Echo "True"
End If
22 changes: 22 additions & 0 deletions tests/inputs/vba_test.vba
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Attribute VB_Name = "Module1"
' VBA (Visual Basic for Applications) example
' This would typically be found in Excel, Word, or Access

Option Explicit

Sub HelloWorld()
' This is a VBA subroutine
MsgBox "Hello from VBA!"
End Sub

Function AddNumbers(x As Integer, y As Integer) As Integer
' VBA function to add two numbers
AddNumbers = x + y
End Function

Private Sub Worksheet_Change(ByVal Target As Range)
' Event handler - typical in VBA
If Target.Address = "$A$1" Then
Range("B1").Value = "Cell A1 was changed"
End If
End Sub
25 changes: 25 additions & 0 deletions tests/inputs/vbnet_test.vb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Imports System
Imports System.Collections.Generic

' VB.NET example
Namespace HelloWorldApp
Public Class Program
Public Shared Sub Main(args As String())
Console.WriteLine("Hello from VB.NET!")

Dim numbers As New List(Of Integer)
numbers.Add(1)
numbers.Add(2)
numbers.Add(3)

For Each num As Integer In numbers
Console.WriteLine($"Number: {num}")
Next
End Sub

' VB.NET method with modern syntax
Public Function CalculateSum(values As List(Of Integer)) As Integer
Return values.Sum()
End Function
End Class
End Namespace
21 changes: 0 additions & 21 deletions tests/outputs/VisualBasic.Net.vba.yaml

This file was deleted.

21 changes: 21 additions & 0 deletions tests/outputs/test.Dsr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
# github.com/AlDanial/cloc
header :
cloc_url : github.com/AlDanial/cloc
cloc_version : 2.07
elapsed_seconds : 0.00898003578186035
n_files : 1
n_lines : 20
files_per_second : 111.358130890747
lines_per_second : 2227.16261781495
report_file : tests/outputs/test.Dsr.yaml
'Visual Basic' :
nFiles: 1
blank: 2
comment: 12
code: 6
SUM:
blank: 2
comment: 12
code: 6
nFiles: 1
21 changes: 21 additions & 0 deletions tests/outputs/test.vbhtml.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
# github.com/AlDanial/cloc
header :
cloc_url : github.com/AlDanial/cloc
cloc_version : 2.07
elapsed_seconds : 0.0128321647644043
n_files : 1
n_lines : 18
files_per_second : 77.9291739437405
lines_per_second : 1402.72513098733
report_file : tests/outputs/test.vbhtml.yaml
'Visual Basic .NET' :
nFiles: 1
blank: 1
comment: 1
code: 16
SUM:
blank: 1
comment: 1
code: 16
nFiles: 1
21 changes: 21 additions & 0 deletions tests/outputs/test.vbs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
# github.com/AlDanial/cloc
header :
cloc_url : github.com/AlDanial/cloc
cloc_version : 2.07
elapsed_seconds : 0.00967001914978027
n_files : 1
n_lines : 10
files_per_second : 103.412411548608
lines_per_second : 1034.12411548608
report_file : tests/outputs/test.vbs.yaml
'VBScript' :
nFiles: 1
blank: 1
comment: 3
code: 6
SUM:
blank: 1
comment: 3
code: 6
nFiles: 1
20 changes: 20 additions & 0 deletions tests/outputs/vba_test.vba.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
# github.com/AlDanial/cloc
header :
cloc_url : github.com/AlDanial/cloc
cloc_version : 2.07
elapsed_seconds : 0.00922179222106934
n_files : 1
n_lines : 22
files_per_second : 108.43879107526
lines_per_second : 2385.65340365573
'VBA' :
nFiles: 1
blank: 4
comment: 6
code: 12
SUM:
blank: 4
comment: 6
code: 12
nFiles: 1
Loading