Skip to content

Commit 1dcf6b3

Browse files
committed
allow line label and other code in one line:
``` LineLabel: Dim X as Long ```
1 parent 96dbeb7 commit 1dcf6b3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

source/modules/DeclarationDict.cls

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,15 +220,15 @@ Private Function PrepareCode(ByVal Code As String, ByVal RegEx As RegExp) As Str
220220
' remove comments
221221
'.Pattern = "'(.*)[\r\n]"
222222
.Pattern = "'(.*)([\r\n]|$)"
223-
Code = .Replace(Code, "$2")
223+
Code = .Replace(Code, "$2")
224224

225225
#If DebugPrintEnabled Then
226226
DebugPrint Code, True, "PrepareCode- after remove comments"
227227
#End If
228228

229229
' treat line labels as dim (but not line numbers)
230-
.Pattern = "([\r\n]|^)([^0-9\r\n]\S*):([\r\n]|$)"
231-
Code = .Replace(Code, "$1Dim $2$3")
230+
.Pattern = "([\r\n]|^)([^0-9\r\n]\S*):(\s|[\r\n]|$)"
231+
Code = .Replace(Code, "$1Dim $2:$3")
232232

233233
' dim a as String: a = 5 => insert line break
234234
.Pattern = "(\:\s)"

0 commit comments

Comments
 (0)